Snippets Collections
Math.ceil();
Math.floor();
Math.sqrt();

// Array Length
arrayName.length 

// Push & POP

var myList = ["item1","item2","item3","item4"];

myList.push("item4"); // first
myList.unshift("item0"); // Last

var lastElement = myList.pop(); // first
var firstElement = myList.shift(); // last

// Splice & Slice

var list = [
  "saturday", // 0 = -7
  "sunday", // 1 = -6
  "monday", // 2 = -5
  "tuesday", // 3 = -4
  "wednesday", // 4 = -3
  "thursday", // 5 = -2
  "friday", // 6 = -1
];

var portion = list.slice(2, 5);
console.log(portion);

slice(startingIndex, afterEndingIndex)
splice(startingIndex, numberOfElement)

// shallow copy
// deep copy

// Marge Array - concat()

var list1 =[];
var list2 =[];
var list3 =[];

var list4 = list1.concate(list2);
var list = list1.concate(list2,list3);
var list = [].concate(list1,list2,list3);

// Array Sorting - Number

var list = [
  5,4,18,44,9,4,78,1,68,49,71,7,74
];

var length = list.length-1;

for(var i=0; i<length; i++) {
  for(var j=0; j<length; j++) {
    if(list[j] > list[j+1]) {
      [ list[j], list[j+1] ] = [ list[j+1], list[j] ];
    }
  }
}
console.log(list);

// Split and Join

Les extensions
Pour accéder aux extensions de VSC (Visual Studio Code), il suffit d'entrer la combinaison CTRL + SHIFT + X sur votre clavier. Ensuite il vous suffit de rechercher les extensions que nous allons utiliser dans cette série :
JavaScript (ES6) code snippets
Ayu
Color Highlight
ESLint
markdownlint
npm
npm intellisense
Path intellisense
Prettier - Code formatter
L'environnement
Nous allons préparer l'environnement pour la série à venir.
Prérequis
Pour cette série, nous aurons besoin de plusieurs logiciels :
Python 2.7
Node 8+ (prenez une version 8.x.x)
Windows Build Tools
Discord
Visual Studio Code
Git
Pour installer les deux premiers logiciels, il vous suffit de taper la commande suivante :  npm i -g --add-python-to-path --production windows-build-tools.
Create - 
  c:\>Python35\python -m venv c:\path\to\myenv

Activate -
	.\peak_alerts\Scripts\activate
<!-- BODY COPY - FULL WIDTH : START --><!--[if (gte mso 9)|(IE)]><table role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="center" valign="top" width="100%"><![endif]--><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background-color: #ffffff;" width="100%">
 
  <tr>
   <td>
    <!--[if (gte mso 9)|(IE)]><table role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" width="600" style="width:520px;"><tr><td align="center" valign="top" width="100%"><![endif]--><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="max-width:520px;">
     
      <tr>
       <td>
        <!-- PARAGRAPH : START --><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation">
         
          <tr>
           <td align="center" style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); padding: 0px 0px 0px; font-weight: 400; font-size: 14px; line-height: 16px;">
            <!--[if (gte mso 9)|(IE)]><table role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" width="600" style="width:520px;"><tr><td align="center" valign="top" width="100%"><![endif]--><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="">
             
              <tr>
               <td style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 14px; line-height: 16px; text-align: center;" width="20%">
                <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="" width="100%">
                 
                  <tr>
                   <td align="center" style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 14px; line-height: 16px; text-align: center;" width="100%">
                    <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="">
                     
                      <tr>
                       <td style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 14px; line-height: 16px; text-align: center; vertical-align: top;">
                        <img alt="After you submit a contact dealer request" data-assetid="300184" height="70" src="https://image.em.cat.com/lib/fe4015707564077b751673/m/1/d5cf2362-9e33-4405-8109-2eaef2dafe43.png" style="padding: 0px; height: 70px; width: 70px; text-align: center; border: 0px;" width="70"></td></tr></table></td></tr><tr>
                   <td style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 18px; line-height: 20px; text-align: center; padding:20px 0px 10px;" width="100%">
                    <b>Contact Your Dealer</b><br>
                    &nbsp;</td></tr></table></td><td style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 14px; line-height: 16px; text-align: center;" width="4%">
                <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="">
                 
                  <tr>
                   <td align="center" style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 14px; line-height: 16px; text-align: center;" width="100%">
                    <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="">
                     
                      <tr>
                       <td style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 14px; line-height: 16px; text-align: center; vertical-align: top;">
                        <img alt="A dealer will call to" data-assetid="292813" height="16" src="https://image.em.cat.com/lib/fe4015707564077b751673/m/1/8225785f-366d-4f91-b3d6-e7ef68a62944.png" style="padding: 0px; height: 16px; width: 30px; text-align: center; border: 0px;" width="30"></td></tr></table></td></tr><tr>
                   <td style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 18px; line-height: 18px; text-align: center; padding:20px 10px 10px" width="100%">
                    &nbsp;<br>
                    &nbsp;<br>
                    &nbsp;</td></tr></table></td><td style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 14px; line-height: 16px; text-align: center;" width="20%">
                <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="" width="100%">
                 
                  <tr>
                   <td align="center" style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 14px; line-height: 16px; text-align: center;" width="100%">
                    <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="">
                     
                      <tr>
                       <td style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 14px; line-height: 16px; text-align: center; vertical-align: top;">
                        <img alt="Gather Information" data-assetid="300180" height="70" src="https://image.em.cat.com/lib/fe4015707564077b751673/m/1/3d583281-851b-4f63-8aa1-2c8e18c78752.png" style="padding: 0px; height: 70px; width: 70px; text-align: center; border: 0px;" width="70"></td></tr></table></td></tr><tr>
                   <td style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 18px; line-height: 20px; text-align: center; padding:20px 10px 10px;" width="100%">
                    <b>Gather Information</b><br>
                    &nbsp;</td></tr></table></td><td style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 14px; line-height: 16px; text-align: center;" width="4%">
                <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="">
                 
                  <tr>
                   <td align="center" style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 14px; line-height: 16px; text-align: center;" width="100%">
                    <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="">
                     
                      <tr>
                       <td style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 14px; line-height: 16px; text-align: center;">
                        <img alt="And" data-assetid="292813" height="16" src="https://image.em.cat.com/lib/fe4015707564077b751673/m/1/8225785f-366d-4f91-b3d6-e7ef68a62944.png" style="padding: 0px; height: 16px; width: 30px; text-align: center; border: 0px;" width="30"></td></tr></table></td></tr><tr>
                   <td style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 18px; line-height: 18px; text-align: center; padding:20px 10px 10px" width="100%">
                    &nbsp;<br>
                    &nbsp;<br>
                    &nbsp;</td></tr></table></td><td style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 14px; line-height: 16px; text-align: center;" width="20%">
                <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="" width="100%">
                 
                  <tr>
                   <td align="center" style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 14px; line-height: 16px; text-align: center;" width="100%">
                    <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="">
                     
                      <tr>
                       <td style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 14px; line-height: 16px; text-align: center;">
                        <img alt="Discuss Options" data-assetid="300183" height="70" src="https://image.em.cat.com/lib/fe4015707564077b751673/m/1/a778e498-a191-4feb-8e9e-3de83083d8bd.png" style="padding: 0px; height: 70px; width: 70px; text-align: center; border: 0px;" width="70"></td></tr></table></td></tr><tr>
                   <td style="font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); font-weight: 400; font-size: 18px; line-height: 20px; text-align: center; padding:20px 0px 10px;" width="100%">
                    <b>Discuss<br>
                    Options</b><br class="mobile-hide">
                    &nbsp;</td></tr></table></td></tr></table></td></tr></table><!-- PARAGRAPH : END --></td></tr></table><!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]--></td></tr></table><!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]--><!--BODY COPY - FULL WIDTH : END -->
#include<stdio.h>

int main()
{
    int i,j,count=1;
    int arr[12][15];
    for(i=0;i<12;i++){
        for(j=0;j<15;j++){
            arr[i][j] = count;
            count++;
        }
    }
    for(i=0;i<15;i++){
        printf("%d\t",arr[0][i]);
    }
    printf("\n");
    for(i=0;i<12;i++){
        printf("%d\n\n",arr[i][0]);
    }
    for(i=0;i<7;i++){
        for(j=0;j<15;j++){
            printf("%d\t",arr[i][j]);
        }
        printf("\n");
    }
    printf("\n");
    for(i=11;i>=0;i--){
        for(j=14;j>=0;j--){
            printf("%d\t",arr[i][j]);
        }
        printf("\n");
    }
    return 0;
}
#include<stdio.h>
void diagnal(int arr[10][10]);
int main()
{
    int arr[10][10],i,j,count=1;
    for(i=0;i<10;i++){
        for(j=0;j<10;j++){
            arr[i][j] = count;
            count++;
        }
    }
    for(i=0;i<10;i++){
        for(j=0;j<10;j++){
            printf("%d\t",arr[i][j]);
        }
        printf("\n");
    }
    printf("\n");
    diagnal(arr);
    return 0;
}
void diagnal(int arr[10][10]){
    int i,j;
     for(i=0;i<10;i++){
        for(j=0;j<10;j++){
            if(i==j){
                printf("%d\t",arr[i][j]);
            }
        }
    }
}
function find_order_with_product_for_user($user_id, $product_id) {
	global $wpdb;

	// Get the order IDs for the user
	$order_ids = $wpdb->get_col("
        SELECT DISTINCT order_items.order_id
        FROM wp_woocommerce_order_items as order_items
        LEFT JOIN wp_woocommerce_order_itemmeta as order_itemmeta ON order_items.order_item_id = order_itemmeta.order_item_id
        LEFT JOIN wp_posts as posts ON order_items.order_id = posts.ID
        LEFT JOIN wp_postmeta as postmeta ON postmeta.post_id = posts.ID
        WHERE posts.post_type = 'shop_order'
        AND posts.post_status IN ('wc-processing', 'wc-completed')
        AND order_itemmeta.meta_key = '_product_id'
        AND order_itemmeta.meta_value = '$product_id'
        AND postmeta.meta_key = '_customer_user'
        AND postmeta.meta_value = '$user_id'
    ");

	// If orders are found, return the order IDs
	if ($order_ids) {
		return $order_ids;
	}

	return false;
}
function course_woocommerce_product_downloads_shortcode($atts) {
	// Extract shortcode attributes
	$atts = shortcode_atts(
		array(
			'product_id' => get_the_ID(), // Specify the product ID
		),
		$atts,
		'custom_woocommerce_product_downloads'
	);

	// Check if the product ID is provided
	if (empty($atts['product_id'])) {
		return '';
	}

	// Get the product object
	$product = wc_get_product($atts['product_id']);
	$order_ids = find_order_with_product_for_user(get_current_user_id(), $atts['product_id']);

	// Check if the product is downloadable
	if ($product && $product->is_downloadable() &&  wc_customer_bought_product(get_current_user_id(), get_current_user_id(), get_the_ID())) {
		$order = wc_get_order(current($order_ids));
		$downloads = $order->get_downloadable_items();
		// Check if there are downloads
		if ($downloads) {
			// Output a list of download files
			$output = '<h2>دانلود دوره خریداری شده ' . esc_html($product->get_name()) . '</h2>';
			$output .= '<ul>';
			foreach ($downloads as $download) {
				if($download['product_id'] != $atts['product_id']){
					continue;
				}
				$output .= '<li><a href="' . esc_url($download['download_url']) . '">' . esc_html($download['download_name']) . "</a></li>";
			}
			$output .= '</ul>';
		} else {
			$output = '<p>هیچ فایل دانلودی برای این دوره موجود نیست.</p>';
		}
	} else {
		$output = '<p>برای مشاهده فایل ها لطفا ابتدا دوره را خریداری کنید</p>';
	}

	return $output;
}
add_shortcode('course_woocommerce_product_downloads', 'course_woocommerce_product_downloads_shortcode');
function find_order_with_product_for_user($user_id, $product_id) {
	global $wpdb;

	// Get the order IDs for the user
	$order_ids = $wpdb->get_col("
        SELECT DISTINCT order_items.order_id
        FROM wp_woocommerce_order_items as order_items
        LEFT JOIN wp_woocommerce_order_itemmeta as order_itemmeta ON order_items.order_item_id = order_itemmeta.order_item_id
        LEFT JOIN wp_posts as posts ON order_items.order_id = posts.ID
        LEFT JOIN wp_postmeta as postmeta ON postmeta.post_id = posts.ID
        WHERE posts.post_type = 'shop_order'
        AND posts.post_status IN ('wc-processing', 'wc-completed')
        AND order_itemmeta.meta_key = '_product_id'
        AND order_itemmeta.meta_value = '$product_id'
        AND postmeta.meta_key = '_customer_user'
        AND postmeta.meta_value = '$user_id'
    ");

	// If orders are found, return the order IDs
	if ($order_ids) {
		return $order_ids;
	}

	return false;
}
function course_woocommerce_product_downloads_shortcode($atts) {
	// Extract shortcode attributes
	$atts = shortcode_atts(
		array(
			'product_id' => get_the_ID(), // Specify the product ID
		),
		$atts,
		'custom_woocommerce_product_downloads'
	);

	// Check if the product ID is provided
	if (empty($atts['product_id'])) {
		return '';
	}

	// Get the product object
	$product = wc_get_product($atts['product_id']);
	$order_ids = find_order_with_product_for_user(get_current_user_id(), $atts['product_id']);

	// Check if the product is downloadable
	if ($product && $product->is_downloadable() &&  wc_customer_bought_product(get_current_user_id(), get_current_user_id(), get_the_ID())) {
		$order = wc_get_order(current($order_ids));
		$downloads = $order->get_downloadable_items();
		// Check if there are downloads
		if ($downloads) {
			// Output a list of download files
			$output = '<h2>دانلود دوره خریداری شده ' . esc_html($product->get_name()) . '</h2>';
			$output .= '<ul>';
			foreach ($downloads as $download) {
				if($download['product_id'] != $atts['product_id']){
					continue;
				}
				$output .= '<li><a href="' . esc_url($download['download_url']) . '">' . esc_html($download['download_name']) . "</a></li>";
			}
			$output .= '</ul>';
		} else {
			$output = '<p>هیچ فایل دانلودی برای این دوره موجود نیست.</p>';
		}
	} else {
		$output = '<p>برای مشاهده فایل ها لطفا ابتدا دوره را خریداری کنید</p>';
	}

	return $output;
}
add_shortcode('course_woocommerce_product_downloads', 'course_woocommerce_product_downloads_shortcode');
8-bit NAND
%%verilog

// definition of 1-bit nand gate [3]
module NAND_gate (
    input I0,
    input I1,
    output O0
);

// logic for nand gate
assign O0 = ~(I0 & I1);

endmodule

// 8-bit NAND gate using eight 1-bit NAND gates [3]
module nand_gate_8bit (
    input [7:0] NAND_in_a,
    input [7:0] NAND_in_b,
    output [7:0] NAND_out
);

// instantiation of eight 1-bit NAND gates
NAND_gate inst1(NAND_in_a[0], NAND_in_b[0], NAND_out[0]);
NAND_gate inst2(NAND_in_a[1], NAND_in_b[1], NAND_out[1]);
NAND_gate inst3(NAND_in_a[2], NAND_in_b[2], NAND_out[2]);
NAND_gate inst4(NAND_in_a[3], NAND_in_b[3], NAND_out[3]);
NAND_gate inst5(NAND_in_a[4], NAND_in_b[4], NAND_out[4]);
NAND_gate inst6(NAND_in_a[5], NAND_in_b[5], NAND_out[5]);
NAND_gate inst7(NAND_in_a[6], NAND_in_b[6], NAND_out[6]);
NAND_gate inst8(NAND_in_a[7], NAND_in_b[7], NAND_out[7]);

endmodule

// test bench for nand gate [3]
module nand_tb();
  // input signals
  reg [7:0] NAND_in_a, NAND_in_b;
  // output signals
  wire [7:0] NAND_out;
  nand_gate_8bit INST(NAND_in_a, NAND_in_b, NAND_out);

  // block for test bench
  initial begin
    $display("nand test bench");
    #10 NAND_in_a=8'b0000001; NAND_in_b=8'b0000001;
    #10 $monitor("%b NAND %b = %b", NAND_in_a,NAND_in_b,NAND_out);
    #10 NAND_in_a=8'b00011111; NAND_in_b=8'b00110011;
    $finish;
  end
endmodule

8-BIT OR-GATE
%%verilog
// or gate - quiñones
module OR_gate (
    input I0,
    input I1,
    output O0
);

assign O0 = I0 | I1;

endmodule


module or_gate_8bit (
    input [7:0] OR_in_a,
    input [7:0] OR_in_b,
    output [7:0] OR_out
);

OR_gate inst1(OR_in_a[0], OR_in_b[0], OR_out[0]);
OR_gate inst2(OR_in_a[1], OR_in_b[1], OR_out[1]);
OR_gate inst3(OR_in_a[2], OR_in_b[2], OR_out[2]);
OR_gate inst4(OR_in_a[3], OR_in_b[3], OR_out[3]);
OR_gate inst5(OR_in_a[4], OR_in_b[4], OR_out[4]);
OR_gate inst6(OR_in_a[5], OR_in_b[5], OR_out[5]);
OR_gate inst7(OR_in_a[6], OR_in_b[6], OR_out[6]);
OR_gate inst8(OR_in_a[7], OR_in_b[7], OR_out[7]);

endmodule

module or_tb();
  reg [7:0] OR_in_a, OR_in_b;
  wire [7:0] OR_out;
  or_gate_8bit INST(OR_in_a, OR_in_b, OR_out);

  initial begin
    $display("or test bench");
    #10 OR_in_a=8'b10000000; OR_in_b=8'b00000001;
    #10 $monitor("%b OR %b = %b", OR_in_a, OR_in_b, OR_out);
    #10 OR_in_a=8'b00011111; OR_in_b=8'b00110011;
    $finish;
  end
endmodule

8-BIT XOR-GATE
%%verilog

// definition of 1-bit xor gate [3]
module XOR_gate (
    input I0,
    input I1,
    output O0
);

// logic for xor gate
assign O0 = I0 ^ I1;

endmodule

// definition of 8-bit xor gate using 1-bit xor gates [3]
module xor_gate_8bit (
    input [7:0] XOR_in_a,
    input [7:0] XOR_in_b,
    output [7:0] XOR_out
);

// instantiation
XOR_gate inst1(XOR_in_a[0], XOR_in_b[0], XOR_out[0]);
XOR_gate inst2(XOR_in_a[1], XOR_in_b[1], XOR_out[1]);
XOR_gate inst3(XOR_in_a[2], XOR_in_b[2], XOR_out[2]);
XOR_gate inst4(XOR_in_a[3], XOR_in_b[3], XOR_out[3]);
XOR_gate inst5(XOR_in_a[4], XOR_in_b[4], XOR_out[4]);
XOR_gate inst6(XOR_in_a[5], XOR_in_b[5], XOR_out[5]);
XOR_gate inst7(XOR_in_a[6], XOR_in_b[6], XOR_out[6]);
XOR_gate inst8(XOR_in_a[7], XOR_in_b[7], XOR_out[7]);

endmodule

// test bench for xor gate [3]
module xor_tb();
  // input signals
  reg [7:0] XOR_in_a, XOR_in_b;
  // output signals
  wire [7:0] XOR_out;
  xor_gate_8bit INST(XOR_in_a, XOR_in_b, XOR_out);

  initial begin
    $display("xor test bench");
    #10 XOR_in_a=8'b0000001; XOR_in_b=8'b0000001;
    #10 $monitor("%b XOR %b = %b", XOR_in_a,XOR_in_b,XOR_out);
    #10 XOR_in_a=8'b00011111; XOR_in_b=8'b00110011;
    $finish;
  end
endmodule

PROJ-FUNC
%%verilog
// definition of 1-bit OR gate
module OR_gate (
    input I0,
    input I1,
    output O0
);

// logic for OR
assign O0 = I0 | I1;

endmodule

// definition of 8-bit OR gate
module or_gate_8bit (
    input [7:0] OR_in_a,
    input [7:0] OR_in_b,
    output [7:0] OR_out
);

// instantiation of eight 1-bit OR gates
OR_gate inst1(OR_in_a[0], OR_in_b[0], OR_out[0]);
OR_gate inst2(OR_in_a[1], OR_in_b[1], OR_out[1]);
OR_gate inst3(OR_in_a[2], OR_in_b[2], OR_out[2]);
OR_gate inst4(OR_in_a[3], OR_in_b[3], OR_out[3]);
OR_gate inst5(OR_in_a[4], OR_in_b[4], OR_out[4]);
OR_gate inst6(OR_in_a[5], OR_in_b[5], OR_out[5]);
OR_gate inst7(OR_in_a[6], OR_in_b[6], OR_out[6]);
OR_gate inst8(OR_in_a[7], OR_in_b[7], OR_out[7]);

endmodule

// definition of 1-bit sub [3]
module subtract1(
  input a_bit, b_bit,
  input cin_bit,
  output sum_bit,
  output cout_bit
  );

  // logic for 1-bit subtraction
  assign sum_bit = (a_bit ^ b_bit) ^ cin_bit;
  assign cout_bit = (~a_bit & b_bit) | (~(a_bit ^ b_bit) & cin_bit);

endmodule

// definition of 8-bit sub [3]
module subtract_8bits(
    input [7:0] a,
    input [7:0] b,
    output [7:0] result
);

wire [7:0] borrow;

// instantiation of eight 1-bit subtractors
subtract1 sub[7:0] (
    .a_bit(a[0]),
    .b_bit(b[0]),
    .cin_bit(1'b0),
    .sum_bit(result[0]),
    .cout_bit(borrow[0])
  );

  // generate block for loop instantiation
  generate
    genvar i;
    for (i = 1; i < 8; i = i + 1) begin : sub_gen
      subtract1 sub_i (
        .a_bit(a[i]),
        .b_bit(b[i]),
        .cin_bit(borrow[i-1]),
        .sum_bit(result[i]),
        .cout_bit(borrow[i])
      );
    end
  endgenerate

endmodule

// function combining OR and subtract operations
module proj_func(
  input [7:0] func_in_a,
  input [7:0] func_in_b,
  output [7:0] func_out
);

wire [0:7] OR_out;

// or gate
or_gate_8bit inst1(
    .OR_in_a(func_in_a),
    .OR_in_b(func_in_b),
    .OR_out(OR_out)
);

// subtractor
subtract_8bits inst2 (
    .a(OR_out),
    .b(func_in_b),
    .result(func_out)
);

endmodule

// test bench for function
module function_tb;
    reg [7:0] a;
    reg [7:0] b;
    wire [7:0] out;

    proj_func f7(a,b,out);

      initial begin
        a = 8'b10000000; b=8'b00000001;
        #10 $display("out = %b", out);
        $finish;
      end
endmodule
<script>
        let up = document.getElementById('GFG_UP');
        let down = document.getElementById('GFG_DOWN');
        let div = document.getElementById('GFG_DIV');
        up.innerHTML = "Click on button to remove the element.";
 
        function GFG_Fun() {
            div.parentNode.removeChild(div);
            down.innerHTML = "Element is removed.";
        }
    </script>
/**
 * /**
 *@NApiVersion 2.1
 *@NScriptType ClientScript
 */
define(["N/format", "N/search"], function (format, search) {
  validateLine = (context) => {
    try {
      var recObj = context.currentRecord;
      var returnValue = true;
      var alertMessage;

      if (context.sublistId == "recmachcustrecord_hcg_employee3") {
        //get current start and end date, and compare with all the lines start and end date wether it line between those date or not
        var CurrentLineIndex = recObj.getCurrentSublistIndex({
          sublistId: "recmachcustrecord_hcg_employee3",
        });

        log.debug("CurrentLineIndex", CurrentLineIndex);

        var currentLineStartDate = recObj.getCurrentSublistValue({
          sublistId: "recmachcustrecord_hcg_employee3",
          fieldId: "custrecord_hcg_start_date6",
        }); //get current start date

        var currentLineEndDate = recObj.getCurrentSublistValue({
          sublistId: "recmachcustrecord_hcg_employee3",
          fieldId: "custrecord_hcg_end_date6",
        }); //get current end date

        log.debug("current currentLineStartDate ", currentLineStartDate + " currentLineEndDate " + currentLineEndDate);

        var currentLineStartDate = new Date(currentLineStartDate);
        var currentLineEndDate = new Date(currentLineEndDate);

        log.debug("current currentLineStartDate ", currentLineStartDate + " currentLineEndDate " + currentLineEndDate);

        var lineCount = recObj.getLineCount({
          sublistId: "recmachcustrecord_hcg_employee3",
        });
        log.debug("lineCount", lineCount);

        for (var i = 0; i < lineCount; i++) {
          if (i != CurrentLineIndex) {
            //current editing index should not be compared. else it would be comparing same index values that would satisfy the condition.
            log.debug("inside loop i=", i);
            var startDateLine = recObj.getSublistValue({
              sublistId: "recmachcustrecord_hcg_employee3",
              fieldId: "custrecord_hcg_start_date6",
              line: i,
            }); //get start date of line

            var endDateLine = recObj.getSublistValue({
              sublistId: "recmachcustrecord_hcg_employee3",
              fieldId: "custrecord_hcg_end_date6",
              line: i,
            }); //get end date of line

            startDateLine = new Date(startDateLine);
            endDateLine = new Date(endDateLine);

            log.debug("startDateLine ", startDateLine + " endDateLine " + endDateLine);

            //if current start date and current end date  is in between the existing startDateLine and endDateLine then give alert
            if (
              (currentLineStartDate >= startDateLine && currentLineEndDate <= endDateLine) || //current start date and current end date lies between any already present start date and end date.
              (currentLineStartDate >= startDateLine && currentLineStartDate <= endDateLine) || //Current start date lies between any already present start and end date.(this means date is overlapping)
              (currentLineEndDate >= startDateLine && currentLineEndDate <= endDateLine) // Current end date lies between any already present start and end date.(this means date is overlapping)
            ) {
              //|| (currentLineEndDate >= startDateLine && currentLineEndDate <= endDateLine)
              log.debug("condition matched");
              returnValue = false;
              alertMessage = "Start Date and End Date should not be between the existing date range";

              alert(alertMessage);

              break;
            }
          }
        }

        return returnValue;
      }
    } catch (error) {
      log.error("error in validate line =", error);
    }
  };

  return {
    validateLine: validateLine,
  };
});
// Update the custom field with the dynamic OG image URL
// function update_og_image_field($post_id) {
// if (has_post_thumbnail($post_id)) {
// $image_url = generate_dynamic_og_image($post_id); // Generate the dynamic OG image URL
// update_post_meta($post_id, 'og_image', $image_url);
// }
// }
// add_action('save_post', 'update_og_image_field');

// // Retrieve the OG image URL and include it in the <meta> tags
// function display_og_image() {
// if (is_singular()) {
// $post_id = get_queried_object_id();
// $og_image = get_post_meta($post_id, 'og_image', true);
// if (!empty($og_image)) {
// echo '<meta property="og:image" content="' . esc_url($og_image) . '">';
// }
// }
// }
// add_action('wp_head', 'display_og_image');
<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='expires' content='0'>
<meta http-equiv='pragma' content='no-cache'>

function add_slug_body_class( $classes ) {
global $post;
if ( isset( $post ) ) {
$classes[] = $post->post_type . '-' . $post->post_name;
}
return $classes;
}
add_filter( 'body_class', 'add_slug_body_class' );
All are good
People who are close to the heart are very good
The ones that are close to the heart are the best
.modal-dialog--schedule-tour .modal-content__list-view


.modal-schedule-tour .map__overlay .gm-style-iw-d .school-list > .school-list__image{}

.modal-schedule-tour .map__overlay .gm-style-iw-d

.modal-schedule-tour .modal-content__list-view {}
// Function to set the height of headings within a specific row
function setHeadingHeight(rowId) {
// Get all heading elements inside the specified row
const headings = document.querySelectorAll(.${rowId} .mints-name);

// Find the maximum height among all heading elements in this row
let maxHeight = 0;
headings.forEach(heading => {
const height = heading.getBoundingClientRect().height;
maxHeight = Math.max(maxHeight, height);
});

// Set the height of all heading elements in this row to the maximum height
headings.forEach(heading => {
heading.style.height = ${maxHeight}px;
});
}

// Call the function for each row
setHeadingHeight('owl-stage');
setHeadingHeight('projects-carousel');
// Call for other rows as needed
<?xml version="1.0" encoding="UTF-8"?>
<configuration>

    <property name="LOGS" value="./logs"/>
    <property name="SERVICE" value="gateway-tts"/>

    <appender name="Console"
              class="ch.qos.logback.core.ConsoleAppender">
        <layout class="ch.qos.logback.classic.PatternLayout">
            <Pattern>
                %black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable
            </Pattern>
        </layout>
    </appender>

    <appender name="RollingFile"
              class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${LOGS}/${SERVICE}.log</file>
        <encoder
                class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <Pattern>%d %p %C{1.} [%t] %m%n</Pattern>
        </encoder>

        <rollingPolicy
                class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${LOGS}/%d{yyyy-MM}/${SERVICE}-%d{yyyy-MM-dd}.log</fileNamePattern>
            <maxHistory>7</maxHistory>
        </rollingPolicy>
    </appender>

    <!-- LOG everything at INFO level -->
    <root level="info">
        <appender-ref ref="RollingFile"/>
        <appender-ref ref="Console"/>
    </root>

    <!-- LOG "com.baeldung*" at TRACE level -->
    <logger name="com.baeldung" level="trace" additivity="false">
        <appender-ref ref="RollingFile"/>
        <appender-ref ref="Console"/>
    </logger>

    <logger name="org.apache.poi" level="ERROR" />

</configuration>
def prophet_features(df, horizon=24*7): 
    temp_df = df.reset_index() 
    temp_df = temp_df[['datetime', 'count']] 
    temp_df.rename(columns={'datetime': 'ds', 'count': 'y'}, inplace=True) 
 
    # Using the data from the previous week as an example for validation 
    train, test = temp_df.iloc[:-horizon,:], temp_df.iloc[-horizon:,:] 
 
    # Define the Prophet model 
    m = Prophet( 
                growth='linear', 
                seasonality_mode='additive', 
                interval_width=0.95, 
                daily_seasonality=True, 
                weekly_seasonality=True, 
                yearly_seasonality=False 
            ) 
    # Train the Prophet model 
    m.fit(train) 
 
    # Extract features from the data, using Prophet to predict the training set
    predictions_train = m.predict(train.drop('y', axis=1)) 
    # Use Prophet to extract features from the data to predict the test set
    predictions_test = m.predict(test.drop('y', axis=1)) 
    # Combine predictions from the training and test sets
    predictions = pd.concat([predictions_train, predictions_test], axis=0) 
 
    return predictions



def train_time_series_with_folds_autoreg_prophet_features(df, horizon=24*7, lags=[1, 2, 3, 4, 5]): 
    
    # Create a dataframe containing all the new features created with Prophet
    new_prophet_features = prophet_features(df, horizon=horizon) 
    df.reset_index(inplace=True) 
 
    # Merge the Prophet features dataframe with our initial dataframe
    df = pd.merge(df, new_prophet_features, left_on=['datetime'], right_on=['ds'], how='inner') 
    df.drop('ds', axis=1, inplace=True) 
    df.set_index('datetime', inplace=True) 
 
    # Use Prophet predictions to create some lag variables (yhat column)
    for lag in lags: 
        df[f'yhat_lag_{lag}'] = df['yhat'].shift(lag) 
    df.dropna(axis=0, how='any') 
 
    X = df.drop('count', axis=1) 
    y = df['count'] 
 
    # Using the data from the previous week as an example for validation
    X_train, X_test = X.iloc[:-horizon,:], X.iloc[-horizon:,:] 
    y_train, y_test = y.iloc[:-horizon], y.iloc[-horizon:] 
 
    # Define the LightGBM model, train, and make predictions
    model = LGBMRegressor(random_state=42) 
    model.fit(X_train, y_train) 
    predictions = model.predict(X_test) 
 
    # Calculate MAE 
    mae = np.round(mean_absolute_error(y_test, predictions), 3)     
 
    # Plot the real vs prediction for the last week of the dataset
    fig = plt.figure(figsize=(16,6)) 
    plt.title(f'Real vs Prediction - MAE {mae}', fontsize=20) 
    plt.plot(y_test, color='red') 
    plt.plot(pd.Series(predictions, index=y_test.index), color='green') 
    plt.xlabel('Hour', fontsize=16) 
    plt.ylabel('Number of Shared Bikes', fontsize=16) 
    plt.legend(labels=['Real', 'Prediction'], fontsize=16) 
    plt.grid() 
    plt.show()
.test {
    width: 200px; 
    height: 200px;
    background-color:skyblue;
    overflow-y: scroll;

    -ms-overflow-style: none; /* 인터넷 익스플로러 */
    scrollbar-width: none; /* 파이어폭스 */
}

.test::-webkit-scrollbar {
    display: none; /* 크롬, 사파리, 오페라, 엣지 */
}
שיטת משלוח 1: ישראל > ירושלים
שיטת משלוח 2: ישראל > בית שמש, ביתר, בני ברק, אלעד וכו׳ וכו׳....
type RemoveNaughtyChildren<T> = {
  [K in keyof T as K extends `naughty_${string}` ? never : K]: T[K];
};
.center-five-columns,
.center-seven-columns {
    display: flex;
    column-gap: 30px;
    row-gap: 50px;
    justify-content: center;
    flex-wrap: wrap;
}

.center-five-columns .flex_column,
.center-seven-columns .flex_column {
    width: 100% !important;
}

@media (min-width: 641px) {
    .center-seven-columns .flex_column,
    .center-five-columns .flex_column {
        width: calc(50% - 15px) !important;
    }
}

@media (min-width: 800px) {
    .center-seven-columns .flex_column,
    .center-five-columns .flex_column {
        width: calc(33.33% - 20px) !important;
    }
}

@media (min-width: 1251px) {
    .center-seven-columns .flex_column {
        width: calc(14.28% - 25.72px) !important;
    }

    .center-five-columns .flex_column {
        width: calc(20% - 24px) !important;
    }
}

@media (max-width: 640px) {
    .center-seven-columns .flex_column,
    .center-five-columns .flex_column {
        width: 380px !important;
    }
}
package tests;

import com.adak.ir.LoggingUtils;
import com.epam.reportportal.annotations.attribute.Attribute;
import com.epam.reportportal.annotations.attribute.Attributes;
import com.epam.reportportal.annotations.attribute.MultiKeyAttribute;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileCapabilityType;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.ITestListener;
import org.testng.ITestResult;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Listeners;

import java.net.MalformedURLException;
import java.net.URL;
import java.time.Duration;

@Listeners(BasePage.TestListener.class)
public class BasePage {
    public static final Logger LOGGER = LoggerFactory.getLogger(BasePage.class);
    public static AppiumDriver driver;


    @BeforeClass
    public void Android_setUp() throws MalformedURLException {
        LOGGER.info("آماده سازی دستگاه");

        DesiredCapabilities capabilities = new DesiredCapabilities();

        capabilities.setCapability("appium:automationName", "UIAutomator2");
        capabilities.setCapability("appium:platformVersion", "12");
        capabilities.setCapability("appium:deviceName","RF8NB25E39B");
        capabilities.setCapability("udid","RF8NB25E39B");

        capabilities.setCapability("platformName", "Android");
        capabilities.setCapability(MobileCapabilityType.APP, "/Users/adak/Documents/easypayment_direct_v6.3.4.apk");

        //capabilities.setCapability("appium:app", "/Users/qtroom/Test-project/My/ap_otp/apps/easypayment_direct_v6.4.2.apk");
        capabilities.setCapability("appPackage", "com.sibche.aspardproject.app");
        //capabilities.setCapability("appActivity", "com.sibche.aspardproject.app.ui.activity.LauncherActivity");
        capabilities.setCapability("autoAcceptAlerts", "true");
        driver = new AndroidDriver(new URL("http://localhost:4723/wd/hub"), capabilities);
        driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(30));

    }
    @Attributes(attributes = { @Attribute(key = "Platform", value = "Android"),
            @Attribute(key = "key2", value = "value2") }, multiKeyAttributes = { @MultiKeyAttribute(keys = { "k1", "k2" }, value = "v") })

    public static class TestListener implements ITestListener {
        @Override
        public void onTestStart(ITestResult result) {
            LOGGER.info("Test Started: " + result.getName());
        }

        @Override
        public void onTestSuccess(ITestResult result) {
            LOGGER.info("Test Passed: " + result.getName());
        }

        @Override
        public void onTestFailure(ITestResult result) {
            LOGGER.info("Test Failed: " + result.getName());
            captureScreenshot(result.getMethod().getMethodName());
        }

        private void captureScreenshot(String methodName1) {
            LoggingUtils.logBase64(((TakesScreenshot) driver).getScreenshotAs(OutputType.BASE64), methodName1);
        }
        }



    @AfterClass
    public void tearDown() {
        if(driver != null) {
            ((AndroidDriver) driver).closeApp();
            driver.quit();
        }
    }
}
package tests;

import com.adak.ir.LoggingUtils;
import com.epam.reportportal.annotations.Step;
import com.epam.reportportal.testng.ReportPortalTestNGListener;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.appium.java_client.AppiumBy;
import org.junit.Assert;
import org.openqa.selenium.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;

import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

import static java.lang.Thread.sleep;


@Listeners({ReportPortalTestNGListener.class})
public class AppiumAndroidTest extends BasePage {
    public static final Logger LOGGER = LoggerFactory.getLogger(AppiumAndroidTest.class);


    @Test
    void easypayment() throws InterruptedException, IOException {

        navigateToSplashPage();
        inputNubmer();

     //   Home();
    }


    @Step
    public void navigateToSplashPage() {


        String elementText = "فارسی";
        By byText = AppiumBy.androidUIAutomator("new UiSelector().text(\"" + elementText + "\")");
        WebElement element = driver.findElement(byText);
        element.click();
        String screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BASE64);
        LoggingUtils.logBase64(screenshot, "صفحه معرفی");
        LOGGER.info(" صفحه معرفی");
    }
    @Step
    public void inputNubmer() throws InterruptedException, IOException {

        String baseUrl = "http://192.168.2.112:8090/api/v1/%s";
        String assignBodyTemplate = "{\"operator\": \"%s\", \"simType\": \"%s\", \"appName\": \"%s\"}";
        HttpClient client = HttpClient.newBuilder().build();
        HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create(String.format(baseUrl, "assign")))
                .header("Content-Type", "application/json")
                .POST(HttpRequest.BodyPublishers.ofString(String.format(assignBodyTemplate, "MCI", "CREDIT", "MY_MCI")))
                .build();
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        ObjectMapper objectMapper = new ObjectMapper();
        JsonNode jsonNode = objectMapper.readTree(response.body());
        driver.findElement(By.id("com.sibche.aspardproject.app:id/edit_text")).sendKeys(jsonNode.get("number").asText());
        driver.findElement(By.id("com.sibche.aspardproject.app:id/btn_action")).click();


        request = HttpRequest.newBuilder()
                .uri(URI.create(String.format(baseUrl, "watch?token=" + jsonNode.get("token").asText())))
                .header("Content-Type", "application/json")
                .GET()
                .build();
        response = client.send(request, HttpResponse.BodyHandlers.ofString());
        objectMapper = new ObjectMapper();
        jsonNode = objectMapper.readTree(response.body());
        String code = jsonNode.get("code").asText();
        driver.findElement(By.id("com.sibche.aspardproject.app:id/et_pin_code")).sendKeys(code);
        LOGGER.info("لاگین");



        String screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BASE64);
        LoggingUtils.logBase64(screenshot, "تست otp");
        LOGGER.info(" تست otp");
        //  driver.findElement(By.id("com.sibche.aspardproject.app:id/favorites_container")).isDisplayed();
        sleep(500);
        driver.findElement(By.id("com.sibche.aspardproject.app:id/barcode_view")).isEnabled();

        boolean isWizard = false;
        boolean isFavorites = false;

        try {
            isWizard = driver.findElement(By.id("com.sibche.aspardproject.app:id/wizardPositiveBtn")).isDisplayed();
        } catch (NoSuchElementException e) {
            // Element not found
        }

        try {
            isFavorites = driver.findElement(By.id("com.sibche.aspardproject.app:id/favorites_container")).isDisplayed();
        } catch (NoSuchElementException e) {
            // Element not found
        }

        if (isWizard || isFavorites) {
            LOGGER.info("PASS");
        } else {
            LOGGER.error("Test failed");
            Assert.fail("Test failed");

        }
        String screenshot2 = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BASE64);
        LoggingUtils.logBase64(screenshot2, "نهایی");
        LOGGER.info(" صفحه نهایی");
    }


}
#include<stdio.h>

int main()
{
    int i,j,k,m,n,p,q,sum;
    printf("Enter Rows and Columns of Matrix 1:");
    scanf("%d%d",&m,&n);
    printf("Enter Rows and Columns of Matrix 2:");
    scanf("%d%d",&p,&q);
    int a[m][n],b[p][q],c[m][q];
    if(n != p){
        printf("Can't Multiply Matrices");
    }
    else{
    printf("Enter Matrix 1:\n");
    for(i=0;i<m;i++){
        for(j=0;j<n;j++){
            scanf("%d",&a[i][j]);
        }
    }
    printf("Enter Matrix 2:\n");
    for(i=0;i<p;i++){
        for(j=0;j<q;j++){
            scanf("%d",&b[i][j]);
        }
    }
    printf("Matrix 1:\n");
    for(i=0;i<m;i++){
        for(j=0;j<n;j++){
            printf("%d\t",a[i][j]);
        }
        printf("\n");
    }
    printf("Matrix 2:\n");
    for(i=0;i<p;i++){
        for(j=0;j<q;j++){
            printf("%d\t",b[i][j]);
        }
        printf("\n");
    }
    for(i=0;i<m;i++){
        for(j=0;j<q;j++){
            sum = 0;
            for(k=0;k<m;k++){
                sum = sum + a[i][k] * b[k][j];
            }
                c[i][j] = sum;
         }
    }
    printf("Matrix 3:\n");
    for(i=0;i<m;i++){
        for(j=0;j<q;j++){
            printf("%d\t",c[i][j]);
        }
        printf("\n");
    }
    }

    return 0;
}
<script is:inline>
    document.getElementById('wf-form-Digital-Wings-Contact-Page-Form').addEventListener('submit', function (event) {
      if (window.grecaptcha.getResponse().length > 0) { return; }
      event.preventDefault();
    });
</script>
"Insert what you want to showe in here" * 10 // change number to whatever many time you want to show something//
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "mysql"
  url      = env("DATABASE_URL")
}

//Make a new model Use pascal case in naming. Also make the name in singular
//create model > npx prisma format > npx prisma migrate dev

model Issue {
  id          Int      @id @default(autoincrement())
  title       String   @db.VarChar(255)
  description String   @db.Text
  status      Status   @default(OPEN)
  createdAt   DateTime @default(now())
  updatedAt   DateTime @updatedAt
}

//enum is set of constanst values
enum Status {
  OPEN
  IN_PROGRESS
  CLOSED
}
get-command -Module ISEScriptingGeek
<iframe src="https://sabine725.substack.com/embed" width="480" height="320" style="border:1px solid #EEE; background:white;" frameborder="0" scrolling="no"></iframe>
<?php 
class WP_Skills_MetaBox_MyCustomMetaBox {
  private $screen = array(
	'post',
	'page',
  );

  private $meta_fields = array(
    array(
      'label' => 'My Custom Field',
      'id' => 'my_custom_field',
      'type' => 'text',
      'default' => '',
    )
  );

  public function __construct() {
    add_action('add_meta_boxes', array($this, 'add_meta_boxes'));
    add_action('admin_footer', array($this, 'media_fields'));
    add_action('save_post', array($this, 'save_fields'));
  }

  public function add_meta_boxes() {
    foreach ($this->screen as $single_screen) {
      add_meta_box(
        'MyCustomMetaBox',
        __('My Custom MetaBox', 'text-domain'),
        array($this, 'meta_box_callback'),
        $single_screen,
        'normal',
        'default'
      );
    }
  }

  public function meta_box_callback($post) {
    wp_nonce_field('MyCustomMetaBox_data', 'MyCustomMetaBox_nonce');
    echo 'Lorem ipsum dolor sit amet.';
    $this->field_generator($post);
  }
  public function media_fields() { ?>
    <script>
      jQuery(document).ready(function($) {
        if (typeof wp.media !== 'undefined') {
          var _custom_media = true,
            _orig_send_attachment = wp.media.editor.send.attachment;
          $('.new-media').click(function(e) {
            var send_attachment_bkp = wp.media.editor.send.attachment;
            var button = $(this);
            var id = button.attr('id').replace('_button', '');
            _custom_media = true;
            wp.media.editor.send.attachment = function(props, attachment) {
              if (_custom_media) {
                if ($('input#' + id).data('return') == 'url') {
                  $('input#' + id).val(attachment.url);
                } else {
                  $('input#' + id).val(attachment.id);
                }
                $('div#preview' + id).css('background-image', 'url(' + attachment.url + ')');
              } else {
                return _orig_send_attachment.apply(this, [props, attachment]);
              };
            }
            wp.media.editor.open(button);
            return false;
          });
          $('.add_media').on('click', function() {
            _custom_media = false;
          });
          $('.remove-media').on('click', function() {
            var parent = $(this).parents('td');
            parent.find('input[type="text"]').val('');
            parent.find('div').css('background-image', 'url()');
          });
        }
      });
    </script>
  <?php 
  }

  public function field_generator($post) {
    $output = '';
    foreach ($this->meta_fields as $meta_field) {
      $label = '<label for="' . $meta_field['id'] . '">' . $meta_field['label'] . '</label>';
      $meta_value = get_post_meta($post->ID, $meta_field['id'], true);
      if (empty($meta_value)) {
        if (isset($meta_field['default'])) {
          $meta_value = $meta_field['default'];
        }
      }
      switch ($meta_field['type']) {

        default:
          $input = sprintf(
            '<input %s id="%s" name="%s" type="%s" value="%s">',
            $meta_field['type'] !== 'color' ? 'style="width: 100%"' : '',
            $meta_field['id'],
            $meta_field['id'],
            $meta_field['type'],
            $meta_value
          );
      }
      $output .= $this->format_rows($label, $input);
    }
    echo '<table class="form-table"><tbody>' . $output . '</tbody></table>';
  }

  public function format_rows($label, $input) {
    return '<tr><th>' . $label . '</th><td>' . $input . '</td></tr>';
  }

  public function save_fields($post_id) {
    if (!isset($_POST['mycustommetabox_nonce']))
      return $post_id;
    $nonce = $_POST['mycustommetabox_nonce'];
    if (!wp_verify_nonce($nonce, 'mycustommetabox_data'))
      return $post_id;
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
      return $post_id;
    foreach ($this->meta_fields as $meta_field) {
      if (isset($_POST[$meta_field['id']])) {
        switch ($meta_field['type']) {
          case 'email':
            $_POST[$meta_field['id']] = sanitize_email($_POST[$meta_field['id']]);
            break;
          case 'text':
            $_POST[$meta_field['id']] = sanitize_text_field($_POST[$meta_field['id']]);
            break;
        }
        update_post_meta($post_id, $meta_field['id'], $_POST[$meta_field['id']]);
      } else if ($meta_field['type'] === 'checkbox') {
        update_post_meta($post_id, $meta_field['id'], '0');
      }
    }
  }
}

if (class_exists('WP_Skills_MetaBox_MyCustomMetaBox')) {
  new WP_Skills_MetaBox_MyCustomMetaBox;
};
#include<stdio.h>

int main()
{
    int a[3][3],b[3][3],c[3][3];
    int i,j;
    printf("Enter Matrix 1:\n");
    for(i=0;i<3;i++){
        for(j=0;j<3;j++){
            scanf("%d",&a[i][j]);
        }
    }
    printf("Enter Matrix 2:\n");
    for(i=0;i<3;i++){
        for(j=0;j<3;j++){
            scanf("%d",&b[i][j]);
        }
    }
    printf("Matrix 1:\n");
    for(i=0;i<3;i++){
        for(j=0;j<3;j++){
            printf("%d\t",a[i][j]);
        }
        printf("\n");
    }
    printf("Matrix 2:\n");
    for(i=0;i<3;i++){
        for(j=0;j<3;j++){
            printf("%d\t",b[i][j]);
        }
        printf("\n");
    }
    for(i=0;i<3;i++){
        for(j=0;j<3;j++){
            c[i][j] = a[i][j] + b [i][j];
        }
    }
    printf("Matrix 3:\n");
    for(i=0;i<3;i++){
        for(j=0;j<3;j++){
            printf("%d\t",c[i][j]);
        }
        printf("\n");
    }
    return 0;
}
#include<stdio.h>

int main()
{
    int arr[3][3];
    int i,j,sr,sc;
    printf("Enter Matrix:\n");
    for(i=0;i<3;i++){
        for(j=0;j<3;j++){
            scanf("%d",&arr[i][j]);
        }
    }
    printf("Matrix is:\n");
    for(i=0;i<3;i++){
        for(j=0;j<3;j++){
            printf("%d\t",arr[i][j]);
        }
        printf("\n");
    }
    for(i=0;i<3;i++){
        sr = 0;
        sc = 0;
        for(j=0;j<3;j++){
        sr = sr + arr[i][j];
        sc = sc + arr[j][i];
        }
        printf("The Sum of Row is:-----%d\n",sr);
        printf("The Sum of Coloumn is:-%d\n",sc);
    }
    return 0;
}
Question: 
Write a C program to create a binary tree as shown in bellow, with the following elements: 50, 17, 72, 12, 23, 54, 76, 9, 14, 25 and 67. After creating the tree, perform an in-order traversal to display the elements. 

Answer:

#include <stdio.h>
#include <stdlib.h>

struct Node 
{
    int data;
    struct Node* left;
    struct Node* right;
};

struct Node* createNode(int value)
{
    struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
    newNode -> data = value;
    newNode -> left = NULL;
    newNode -> right = NULL;
    
    return newNode;
}
void inOrderTraversal(struct Node* root)
{
    if(root!=NULL) {
        inOrderTraversal(root -> left);
        printf("%d ", root -> data);
        inOrderTraversal(root -> right);
    }
}

int main() {
   struct Node* root = createNode(50);
   root -> left = createNode(17);
   root -> right = createNode(72);
   
   root -> left -> left = createNode(12);
   root -> left -> right = createNode(23);
   
   root -> left -> left -> left = createNode(9);
   root -> left -> left -> right = createNode(14);
   
   root -> left -> right -> right = createNode(25);
   
   root -> right -> left = createNode(54);
   root -> right -> right = createNode(76);
   root -> right -> left -> right = createNode(67);
   inOrderTraversal(root);

    return 0;
}

//OUTPUT:

In-Order Traversal: 
9 12 14 17 23 25 50 54 67 72 76 
/** @type {import('next').NextConfig} */

const isProd = process.env.NODE_ENV === 'production';
const nextConfig = {
  basePath: isProd ? '/Deploy-a-Next.js-App-to-GitHub-Pages': '',
  output: 'export',
  distDir: 'dist',
  images: {
    unoptimized: true,
  },
}
module.exports = nextConfig
#include <bits/stdc++.h>
using namespace std;

// tree node is defined
class TreeNode {
public:
    int val;
    TreeNode* left;
    TreeNode* right;
    TreeNode(int data)
    {
        val = data;
        left = NULL;
        right = NULL;
    }
};

// inorder traversal to check if the given 
// sorted subsequence exists in the BST
void DoesSeqExistRec(TreeNode* root, vector<int> sequence, int& index)
{
    //base case
    if (!root)
        return;

    // traverse left subtree first as it's inorder traversal
    DoesSeqExistRec(root->left, sequence, index);

    // If current node matches with current sequence 
    // element(sequence[index]) then move
    // to the next element in the sequenece
    if (root->val == sequence[index])
        index++;

    // traverse right subtree
    DoesSeqExistRec(root->right, sequence, index);
}

// function to check whether the sequence exists or not
bool DoesSeqExist(TreeNode* root, vector<int> sequence)
{

    int index = 0;

    // recursive function to check if all elements 
    // of the sequence are in the BST or not
    DoesSeqExistRec(root, sequence, index);

    //if after the inorder traversal as we have discussed, 
    //index reaches towards the end
    //then the BST contains the sequence other wise not
    if (index == sequence.size())
        return true;
    else
        return false;
}

int main()
{
    TreeNode* root = new TreeNode(16);
    
    root->left = new TreeNode(3);
    root->left->right = new TreeNode(13);
    root->left->right->left = new TreeNode(10);
    root->left->right->left->left = new TreeNode(7);
    root->right = new TreeNode(20);
    root->right->left = new TreeNode(18);

    vector<int> sequence1{ 7, 13, 18, 20 };

    if (DoesSeqExist(root, sequence1))
        cout << "Yes the sequence exists in the binary search tree\n";
    else
        cout << "No, the sequence exists in the binary search tree";

    vector<int> sequence2{ 7, 13, 14, 20 };

    if (DoesSeqExist(root, sequence2))
        cout << "Yes the sequence exists in the binary search tree\n";
    else
        cout << "No, the sequence doesn't exist in the binary search tree";

    return 0;
}
#include<stdio.h>

int main()
{
    int n=6,i,j,temp,flag;
    int arr[n] = {60,34,76,23,89,29};
    for(i=0;i<n-1;i++){
        flag = 0;
        for(j=0;j<n-1;j++){
            if(arr[j]>arr[j+1]){
                temp = arr[j];
                arr[j] = arr[j+1];
                arr[j+1] = temp;
                flag = 1;
            }
        }
        if(flag==0){
            break;
        }
    }
    for(i=0;i<n;i++){
        printf("%d ",arr[i]);
    }
    return 0;
}
Function ExcelToCsv ($File) {
    $Excel = New-Object -ComObject Excel.Application
    $wb = $Excel.Workbooks.Open($File)

    $x = $File | Select-Object Directory, BaseName
    $n = [System.IO.Path]::Combine($x.Directory, (($x.BaseName, 'csv') -join "."))

    foreach ($ws in $wb.Worksheets) {
        $ws.SaveAs($n, 6)
    }
    $Excel.Quit()
}

Get-ChildItem C:\Junk\*.xlsx |
    ForEach-Object{
        ExcelToCsv -File $_
    }
#include<stdio.h>

int main()
{
    int arr[8],i,flag=0,n;
    printf("Enter 8 Elements of array:\n");
    for(i=0;i<8;i++){
        printf("arr[%d] = ",i);
        scanf("%d",&arr[i]);
    }
    printf("Enter the element to search in array:");
    scanf("%d",&n);
    for(i=0;i<8;i++){
        if(arr[i] == n){
            flag = 1;
            break;
        }
        else{
            flag = 0;
        }
    }
    if(flag==1){
        printf("The element is found at location : %d",i);
    }
    else{
        printf("Element not found");
    }
    return 0;
}
Calendar = 
  
VAR CalTable = CALENDARAUTO ()
VAR MyCal =
    ADDCOLUMNS (
        CalTable,
        "Index", MONTH ( [Date] ),
        "Month", FORMAT ( [Date], "mmm" ),
        "Qtr", FORMAT ( [Date], "\QQ" ),
        "Year", FORMAT ( [Date], "yyyy" )
    )
RETURN
    MyCal
star

Tue Dec 12 2023 06:14:29 GMT+0000 (Coordinated Universal Time)

@omnixima #javascript

star

Tue Dec 12 2023 03:41:33 GMT+0000 (Coordinated Universal Time) https://getcodingknowledge.gitbook.io/discord-bot-tutoriel-fran-ais/nos-premiers-pas/lenvironnement

@KB6

star

Tue Dec 12 2023 03:40:19 GMT+0000 (Coordinated Universal Time) https://getcodingknowledge.gitbook.io/discord-bot-tutoriel-fran-ais/nos-premiers-pas/lenvironnement

@KB6

star

Mon Dec 11 2023 23:00:45 GMT+0000 (Coordinated Universal Time) https://docs.python.org/3/library/venv.html

@mitali10

star

Mon Dec 11 2023 20:22:03 GMT+0000 (Coordinated Universal Time)

@shirnunn

star

Mon Dec 11 2023 18:28:00 GMT+0000 (Coordinated Universal Time)

@abdul_rehman #c

star

Mon Dec 11 2023 17:54:20 GMT+0000 (Coordinated Universal Time)

@abdul_rehman #c

star

Mon Dec 11 2023 14:02:36 GMT+0000 (Coordinated Universal Time)

@amirabbas8643 #php #wordpress

star

Mon Dec 11 2023 14:02:34 GMT+0000 (Coordinated Universal Time)

@amirabbas8643 #php #wordpress

star

Mon Dec 11 2023 13:40:02 GMT+0000 (Coordinated Universal Time)

@lawlaw

star

Mon Dec 11 2023 13:15:52 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/how-to-remove-an-html-element-using-javascript/

@mubashir_aziz

star

Mon Dec 11 2023 13:12:52 GMT+0000 (Coordinated Universal Time)

@mdfaizi #javascript

star

Mon Dec 11 2023 13:12:26 GMT+0000 (Coordinated Universal Time)

@mubashir_aziz

star

Mon Dec 11 2023 13:09:33 GMT+0000 (Coordinated Universal Time) https://shopify.github.io/liquid/basics/introduction/

@mubashir_aziz

star

Mon Dec 11 2023 13:07:03 GMT+0000 (Coordinated Universal Time) https://pathedits.com/blogs/tips/how-create-transparent-background-photoshop

@mubashir_aziz

star

Mon Dec 11 2023 13:02:16 GMT+0000 (Coordinated Universal Time)

@mubashir_aziz

star

Mon Dec 11 2023 13:00:47 GMT+0000 (Coordinated Universal Time) https://www.wpbeginner.com/wp-themes/how-to-add-page-slug-in-body-class-of-your-wordpress-themes/

@mubashir_aziz

star

Mon Dec 11 2023 12:58:00 GMT+0000 (Coordinated Universal Time)

@mubashir_aziz

star

Mon Dec 11 2023 12:57:40 GMT+0000 (Coordinated Universal Time) https://technoderivation.com/fintech-software-development

@prbhakar #fintechdevelopment #softwareengineering #softwaredevelopment #digitaltransformation #usa #us #uk #2024 #2023 #future #technology #webdevelopment

star

Mon Dec 11 2023 12:55:42 GMT+0000 (Coordinated Universal Time)

@mubashir_aziz

star

Mon Dec 11 2023 12:39:37 GMT+0000 (Coordinated Universal Time)

@mubashir_aziz

star

Mon Dec 11 2023 11:34:22 GMT+0000 (Coordinated Universal Time) https://github.com/codigofacilito/python-concurrente/tree/master

@razek

star

Mon Dec 11 2023 11:33:30 GMT+0000 (Coordinated Universal Time) https://github.com/AlexxIT/go2rtc/wiki/Tunnel-RTSP-camera-to-Intenet

@razek

star

Mon Dec 11 2023 07:09:53 GMT+0000 (Coordinated Universal Time)

@manhmd

star

Mon Dec 11 2023 05:19:01 GMT+0000 (Coordinated Universal Time) https://medium.com/@tubelwj/time-series-forecasting-with-lightgbm-and-prophet-62caca1a926d

@nurdlalila306

star

Mon Dec 11 2023 04:15:34 GMT+0000 (Coordinated Universal Time) https://bskyvision.com/entry/css-스크롤-기능은-작동하지만-스크롤바는-안-보이게-하기

@wheedo #css

star

Mon Dec 11 2023 00:36:21 GMT+0000 (Coordinated Universal Time) undefined

@Deas

star

Sun Dec 10 2023 13:19:20 GMT+0000 (Coordinated Universal Time)

@odesign

star

Sun Dec 10 2023 12:34:37 GMT+0000 (Coordinated Universal Time) https://ayedot.com/6231/MiniBlog/Day-1--Christmas-Cookies--Typehero-Advent-of-TypeScript-Challenge-

@gabe_331 #typescript

star

Sun Dec 10 2023 12:32:56 GMT+0000 (Coordinated Universal Time) https://ayedot.com/6239/MiniBlog/Day-8--Filtering-The-Children-part-3--Typehero-Advent-of-TypeScript-Challenge-

@gabe_331

star

Sun Dec 10 2023 10:56:14 GMT+0000 (Coordinated Universal Time)

@omnixima #css

star

Sun Dec 10 2023 10:13:12 GMT+0000 (Coordinated Universal Time)

@mehran

star

Sun Dec 10 2023 10:12:40 GMT+0000 (Coordinated Universal Time)

@mehran

star

Sun Dec 10 2023 09:24:37 GMT+0000 (Coordinated Universal Time)

@abdul_rehman #c

star

Sun Dec 10 2023 08:38:04 GMT+0000 (Coordinated Universal Time) https://answers.netlify.com/t/know-if-recaptcha-v2-was-checked-or-not/41271/14

@Kiwifruit #forms #recaptcha #captcha

star

Sun Dec 10 2023 06:56:21 GMT+0000 (Coordinated Universal Time)

@SabsZinn123

star

Sun Dec 10 2023 04:54:59 GMT+0000 (Coordinated Universal Time)

@Jeremicah

star

Sun Dec 10 2023 01:23:36 GMT+0000 (Coordinated Universal Time) https://jdhitsolutions.com/blog/powershell/4169/friday-fun-updated-ise-scripting-geek-module/

@baamn #powershell

star

Sun Dec 10 2023 00:19:56 GMT+0000 (Coordinated Universal Time) https://sabine725.substack.com/publish/settings

@sabinesmith

star

Sun Dec 10 2023 00:02:44 GMT+0000 (Coordinated Universal Time) https://wp-skills.com/tools/meta-box-generator

@dmsearnbit

star

Sat Dec 09 2023 21:08:57 GMT+0000 (Coordinated Universal Time) https://www.thiscodeworks.com/extension/initializing?newuser

@Joshuapower297

star

Sat Dec 09 2023 20:28:27 GMT+0000 (Coordinated Universal Time)

@abdul_rehman #c

star

Sat Dec 09 2023 20:15:34 GMT+0000 (Coordinated Universal Time)

@abdul_rehman #c

star

Sat Dec 09 2023 20:10:19 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif #java

star

Sat Dec 09 2023 18:41:06 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v=mJuz45RXeXY

@devbymohsin

star

Sat Dec 09 2023 17:44:36 GMT+0000 (Coordinated Universal Time) https://www.includehelp.com/data-structure-tutorial/check-if-given-sorted-subsequence-exits-in-the-binary-search-tree-or-not.aspx

@AtulPatil

star

Sat Dec 09 2023 17:22:39 GMT+0000 (Coordinated Universal Time)

@abdul_rehman #c

star

Sat Dec 09 2023 16:47:49 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/answers/questions/597931/convert-xlsx-to-csv-using-powershell

@baamn #powershell

star

Sat Dec 09 2023 15:37:33 GMT+0000 (Coordinated Universal Time)

@abdul_rehman #c

Save snippets that work with our extensions

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