Snippets Collections
import sys

age = input("how old are you?")  # age = str
while age != int:
    try:
        # global age  |: #niazi be Global nist fek konam
        age = int(age)
        break
    except:
        print(f"type error{sys.exc_info()[0]}")
        age = input('your input should be "integer",try again: ')


print(f"you are {age} years old")
class BusinessTrip(models.Model):
    _name = 'business.trip'
    _inherit = ['mail.thread']
    _description = 'Business Trip'

    name = fields.Char(tracking=True)
    partner_id = fields.Many2one('res.partner', 'Responsible',
                                 tracking=True)
    guest_ids = fields.Many2many('res.partner', 'Participants')
// вывод названия атрибута на странице "корзина
add_filter( 'woocommerce_product_variation_title_include_attributes', '__return_false' );
add_filter( 'woocommerce_is_attribute_in_product_name', '__return_false' );
// Display a WooCommerce coupon input field anywhere with a shortcode [coupon_field]
add_shortcode( 'coupon_field', 'display_coupon_field' );
function display_coupon_field() {
    if( isset($_GET['coupon']) && isset($_GET['redeem-coupon']) ){
        if( $coupon = esc_attr($_GET['coupon']) ) {
            $applied = WC()->cart->apply_coupon($coupon);
        } else {
            $coupon = false;
        }

        $success = sprintf( __('Coupon "%s" Applied successfully.'), $coupon );
        $error   = __("This Coupon can't be applied");

        $message = isset($applied) && $applied ? $success : $error;
    }

    $output  = '<div class="redeem-coupon"><form id="coupon-redeem">
    <p><input type="text" name="coupon" id="coupon"/>
    <input type="submit" name="redeem-coupon" value="'.__('Redeem Offer').'" /></p>';

    $output .= isset($coupon) ? '<p class="result">'.$message.'</p>' : '';

    return $output . '</form></div>';
}


// Move custom coupon shortcode before Proceed to checkout button
add_action('woocommerce_proceed_to_checkout','ml_callback_function');
function ml_callback_function(){
    echo do_shortcode( '[coupon_field]' );
}
/**
 * @snippet       $$$ remaining to Free Shipping @ WooCommerce Cart
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 3.9
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */
 
add_action( 'woocommerce_before_cart', 'bbloomer_free_shipping_cart_notice' );
  
function bbloomer_free_shipping_cart_notice() {
  
   $min_amount = 399; //change this to your free shipping threshold
   
   $current = WC()->cart->subtotal;
  
   if ( $current < $min_amount ) {
      $added_text = 'רגע! חבל להפסיד! מגיע לך משלוח חינם אם תוסיף מוצרים בשווי של: ' . wc_price( $min_amount - $current ) . ' שקל בלבד! ';
      //$added_text = 'רגע ! לא חבל להפסיד? מגיע לך משלוח חינם אם תוסיף מוצרים בשווי' . wc_price( $min_amount - $current ) . ' שקל! ';
        // $added_text = 'Get free shipping if you order ' . wc_price( $min_amount - $current ) . ' more!';
      $return_to = wc_get_page_permalink( 'shop' );
      $notice = sprintf( '<a href="%s" class="button wc-forward">%s</a> %s', esc_url( $return_to ), 'Continue Shopping', $added_text );
      wc_print_notice( $notice, 'notice' );
   }
  
}
http://en.wikipedia.org/w/api.php?action=query&prop=pageimages&format=json&piprop=original&titles=India
git filter-branch --force --index-filter \
  'git rm --cached --ignore-unmatch folder/large_file.ext' \
  --prune-empty --tag-name-filter cat -- --all
    public void Update()
    {
        //Get the Screen positions of the object
        Vector2 positionOnScreen = Camera.main.WorldToViewportPoint(transform.position);

        //Get the Screen position of the mouse
        Vector2 mouseOnScreen = (Vector2)Camera.main.ScreenToViewportPoint(Input.mousePosition);

        //Get the angle between the points
        float angle = AngleBetweenTwoPoints(positionOnScreen, mouseOnScreen);

        //Ta Daaa
        transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, angle));
    }
    
    float AngleBetweenTwoPoints(Vector3 a, Vector3 b)
    {
        return Mathf.Atan2(a.y - b.y, a.x - b.x) * Mathf.Rad2Deg;
    }
>>> df1 = pd.DataFrame([["AAA", "BBB"]], columns=["Spam", "Egg"])
>>> df2 = pd.DataFrame([["ABC", "XYZ"]], columns=["Foo", "Bar"])
>>> with ExcelWriter("path_to_file.xlsx") as writer:
...     df1.to_excel(writer, sheet_name="Sheet1")
...     df2.to_excel(writer, sheet_name="Sheet2")
<?php 
    
    // Arry for each line u want in ur charts
    $dataPoints = array();
    $dataMonth = array();

    $dataPoints2 = array();
    $dataPoints3 = array();

    $month = array();

    $dataPoints4 = array();
    $dataPoints5 = array();
    $dataPoints6 = array();

    $dataPoints7 = array();
    $dataPoints8 = array();
    $dataPoints9 = array();
    // making database connection
try {
    $link = new \PDO(   'mysql:host=localhost;dbname=ixora-web;charset=utf8mb4',
                        'ixoraweb', //'root',
                        '!!iXora!!2021@', //'',
                        array(
                            \PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
                            \PDO::ATTR_PERSISTENT => false
                        )
                    );
        // selecting and executing 
        $handle = $link->prepare('select * from hrm'); 
        $handle->execute(); 
        $result = $handle->fetchAll(\PDO::FETCH_OBJ);
	
 // a foreach, for each result, need to make separate array_push for every line u want to produce
    foreach($result as $row) {
      array_push($dataPoints, array("y"=>$row->Temp1, "label" => $row->MonthN)); //, "x"=>$row->Month  MonthN
     
      array_push($dataPoints2, array("y"=> $row->Temp2, "label" => $row->MonthN)); //"y"=> $row->Temp3
      array_push($dataPoints3, array("y"=> $row->Temp3, "label" => $row->MonthN));

      array_push($dataPoints4, array("y"=> $row->Kwh1, "label" => $row->MonthN));
      array_push($dataPoints5, array("y"=> $row->Kwh2, "label" => $row->MonthN));
      array_push($dataPoints6, array("y"=> $row->Kwh3, "label" => $row->MonthN));

      array_push($dataPoints7, array("y"=> $row->BAR1, "label" => $row->MonthN));
      array_push($dataPoints8, array("y"=> $row->BAR2, "label" => $row->MonthN));
      array_push($dataPoints9, array("y"=> $row->BAR3, "label" => $row->MonthN));
 }
	$link = null;
}
    
catch(\PDOException $ex){
        print($ex->getMessage());
  }
>>> d1 = dict(a=1, b=2, c=3, d=4)
>>> d2 = dict(a=1, b=2)
>>> set(d2.items()).issubset( set(d1.items()) )
True
<?php

ob_start();

$API_KEY = "5051368650:AAGyZfWfsUuax5JtGhuAD476d4nLbK9pFMA";
$site = "";

define("API_KEY",$API_KEY);
function bot($method,$str=[]){
        $http_build_query = http_build_query($str);
        $api = "https://api.telegram.org/bot".API_KEY."/".$method."?$http_build_query";
        $http_build_query = file_get_contents($api);
        return json_decode($http_build_query);
}

$update = json_decode(file_get_contents("php://input"));
$message = $update->message;
$id = $message->from->id;
$chat_id = $message->chat->id;
$text = $message->text;
$message_id = $message->message_id;

$backhome = file_get_contents("agza.txt"); 
$backsound = file_get_contents("soundas.txt"); 

include('quranpages.php');

include('qurana_arbaaa.php');

$json = json_decode(file_get_contents("save.txt"),true);
$getjson = json_decode(file_get_contents("save.txt"));

$user = $getjson->$id;
$save = $user->save;

$startsounds = array(
  /*"ختمات الأرباع",*/
  "ختمات الأوجه",
  /*"ختمات السور",*/
  " ♻️ القائمة الرئيسة",
  //"ختمات الأحزاب",
);
$startsoundsafter = array(
  /*"gitmat_al_arbaa",*/
  "gitmat_al_auguh",
  /*"gitmat_al_sour",*/
  /*"gitmat_al_ahzaab"*/
);


$writesave = str_replace($startsounds, $startsoundsafter, $text);

//الباحث النصي
$write = array(
  "ابحث عن آية",
  "تفسير آية - الميسر",
  "تفسير آية - الجلالين",
  "شرح آية باللغة الإنجليزية",
  " ♻️ القائمة الرئيسة",
);
$writeafter = array(
  "search",
  "tafser2",
  "tafser1",
  "english"
);
$writemessage = array(
  "حسنا ، أرسل ما تذكره من الآية ليتم البحث عنها",
  "حسنا ، أرسل ما تذكره من الآية ليتم تفسيرها -تفسير الميسر-",
  "حسنا ، أرسل ما تذكره من الآية ليتم تفسيرها -تفسير الجلالين-",
  "حسنا ، أرسل ما تذكره من الآية ليتم شرحها باللغة الإنجليزية",
);
$writesave = str_replace($write, $writeafter, $text);
$writemessage = str_replace($write, $writemessage, $text);


//الباحث الصوتي

$sound = array(
  "الحصري قالـون",
  /*"عبد الباسط عبد الصـمد",*/
);

$soundafter = array(
  "Al_husari",
  /*"Abdulbasit_abdulsamad",*/
);

$soundsave = str_replace($sound, $soundafter,$text);
/*[['text'=>'الباحث النصي']],*/
//start
if($text == "/start"){
  $json ["$id"]["save"] = "start";
  file_put_contents("save.txt",json_encode($json));
  /*bot("sendMessage",[
    "chat_id"=>$chat_id,
    "text"=>"
    حياك الله في بوت ختمات القران الكريم
   ".$site,
   "reply_to_message_id"=>$message_id,
   "reply_markup"=>json_encode([
     'keyboard'=>[
       [['text'=>'صوتيات القران الكريم']],
     ],
   'resize_keyboard'=>true
  ]),
]);
return;*/
foreach($sound as $ckey){
    $keyboard[] = [$ckey];
  }
  bot("sendMessage",[
    "chat_id"=>$chat_id,
    "text"=>"
        حياك الله في بوت ختمات القران الكريم
    ".$site,
    "reply_to_message_id"=>$message_id,
    "reply_markup"=>json_encode([
      'keyboard'=>$keyboard
    ])
  ]);
  return;
}

if($text == "رجوع 🔙" or $text == "♻️ القائمة الرئيسة"){
    foreach($sound as $ckey){
    $keyboard[] = [$ckey];
  }
  bot("sendMessage",[
    "chat_id"=>$chat_id,
    "text"=>"
    اختر القارئ بالرواية التى تريد
    ".$site,
    "reply_to_message_id"=>$message_id,
    "reply_markup"=>json_encode([
      'keyboard'=>$keyboard
    ])
  ]);
  return;
}

/*if($text == "صوتيات القران الكريم"){
  foreach($startsounds as $key){
    $keyboard[] = [$key];
  }
  bot("sendMessage",[
    "chat_id"=>$chat_id,
    "text"=>"
    حياك الله في بوت ختمات القران الكريم
    ".$site,
    "reply_to_message_id"=>$message_id,
    "reply_markup"=>json_encode([
      'keyboard'=>$keyboard
  ])
]);
  return;
}*/

//أوامر الباحث النصي
/*if($text == "الباحث النصي"){
  foreach($write as $key){
    $keyboard[] = [$key];
  }
  bot("sendMessage",[
    "chat_id"=>$chat_id,
    "text"=>"
     حسنا ، اختر أحد الأقسام
نت :
    ".$site,
    "reply_to_message_id"=>$message_id,
    "reply_markup"=>json_encode([
      'keyboard'=>$keyboard
    ])
   ]);
  return;
}*/


if(in_array($text,$write)){
  $json ["$id"]["save"] = "$writesave";
  file_put_contents("save.txt",json_encode($json));
  bot("sendMessage",[
    "chat_id"=>$chat_id,
    "text"=>$writemessage,
    "reply_to_message_id"=>$message_id,
  ]);
  return;
}

if(in_array($save,$writeafter)){
  $get = json_decode(file_get_contents("https://api-quran.cf/quransql/index.php?text=".urlencode($text)."&type=".$save))->result;
  $count = count($get);
  bot("sendMessage",[
    "chat_id"=>$chat_id,
    "text"=>"تم العثور على $count من النتائج",
    "reply_to_message_id"=>$message_id,
  ]);
  if($count > 10)
    $l = 10;
  else
    $l = $count;
  for( $i=0; $i <= $l; $i++){
  bot("sendMessage",[
    "chat_id"=>$chat_id,
    "text"=>$get[$i],
  ]);
}
  return;
}

//Pages search            ckey

/*
if($text == "/pages"){
  foreach($sound as $ckey){
    $keyboard[] = [$ckey];
  }
  bot("sendMessage",[
    "chat_id"=>$chat_id,
    "text"=>"اختر احد الجزء
    ".$site,
    "reply_to_message_id"=>$message_id,
    "reply_markup"=>json_encode([
      'keyboard'=>$keyboard
    ])
  ]);
  return;
}

if($text == "ختمات الأوجه" or $text == "رجوع 🔙"){
  foreach($sound as $ckey){
    $keyboard[] = [$ckey];
  }
  bot("sendMessage",[
    "chat_id"=>$chat_id,
    "text"=>"اختر احد الجزء
    ".$site,
    "reply_to_message_id"=>$message_id,
    "reply_markup"=>json_encode([
      'keyboard'=>$keyboard
    ])
  ]);
  return;
}*/

if(in_array($text,$sound)){
  $json ["$id"]["save"] = "$soundsave";
  file_put_contents("save.txt",json_encode($json));
/*foreach($parts_auguh as $key){
    $keyboard[] = [$key];
  }*/
bot("sendMessage",[
  "chat_id"=>$chat_id,
  "text"=>"تم إختيار القارئ ، قم الآن بكتابة اسم السورة أو قم بالإختيار من الكيبورد في الاسفل..",
  "reply_to_message_id"=>$message_id,
  "reply_markup"=>json_encode([
    'keyboard'=>[
/*[['text'=>'♻️ القائمة الرئيسة'],['text'=>'🔙 رجـوع']],
[['text'=>'الجزء رقم ٣ '],['text'=>'الجزء رقم ٢ '],['text'=>'الجزء رقم ١ ']],
[['text'=>'الجزء رقم ٦ '],['text'=>'الجزء رقم ٥ '],['text'=>'الجزء رقم ٤ ']],
[['text'=>'الجزء رقم ٩ '],['text'=>'الجزء رقم ٨ '],['text'=>'الجزء رقم ٧ ']],
[['text'=>'الجزء رقم ١٢ '],['text'=>'الجزء رقم ١١ '],['text'=>'الجزء رقم ١٠ ']],
[['text'=>'الجزء رقم ١٥ '],['text'=>'الجزء رقم ١٤ '],['text'=>'الجزء رقم ١٣ ']],
[['text'=>'الجزء رقم ١٨ '],['text'=>'الجزء رقم ١٧ '],['text'=>'الجزء رقم ١٦ ']],
[['text'=>'الجزء رقم ٢١ '],['text'=>'الجزء رقم ٢٠ '],['text'=>'الجزء رقم ١٩ ']],
[['text'=>'الجزء رقم ٢٤ '],['text'=>'الجزء رقم ٢٣ '],['text'=>'الجزء رقم ٢٢ ']],
[['text'=>'الجزء رقم ٢٧ '],['text'=>'الجزء رقم ٢٦ '],['text'=>'الجزء رقم ٢٥ ']],
[['text'=>'الجزء رقم ٣٠ '],['text'=>'الجزء رقم ٢٩ '],['text'=>'الجزء رقم ٢٨ ']],*/
      [['text'=>'رجوع 🔙']],
      [['text'=>'الجزء الثاني'],['text'=>'الجزء الأول']],
      [['text'=>'الجزء الرابع'],['text'=>'الجزء الثالث']],
      [['text'=>'الجزء السادس'],['text'=>'الجزء الخامس']],
      [['text'=>'الجزء الثامن'],['text'=>'الجزء السابع']],
      [['text'=>'الجزء العاشر'],['text'=>'الجزء التاسع']],
      [['text'=>'الجزء الثاني عشر'],['text'=>'الجزء الحادي عشر']],
      [['text'=>'الجزء الرابع عشر'],['text'=>'الجزء الثالث عشر']],
      [['text'=>'الجزء السادس عشر'],['text'=>'الجزء الخامس عشر']],
      [['text'=>'الجزء الثامن عشر'],['text'=>'الجزء السابع عشر']],
      [['text'=>'الجزء العشرون'],['text'=>'الجزء التاسع عشر']],
      [['text'=>'الجزء الثاني و العشرون'],['text'=>'الجزء الحادي و العشرون']],
      [['text'=>'الجزء الرابع و العشرون'],['text'=>'الجزء الثالث و العشرون']],
      [['text'=>'الجزء السادس و العشرون'],['text'=>'الجزء الخامس و العشرون']],
      [['text'=>'الجزء الثامن و العشرون'],['text'=>'الجزء السابع و العشرون']],
      [['text'=>'الجزء الثلاثون'],['text'=>'الجزء التاسع و العشرون']],
    ],
    'resize_keyboard'=>true,
    ])
  ]);
  return;
}

if($text == "🔙 رجـوع"){
/*foreach($parts_auguh as $key){
   $keyboard[] = [$key];
 }*/
bot("sendMessage",[
  "chat_id"=>$chat_id,
  "text"=>
  "
✅ تم إختيار القارئ \n
الأن قم بالإختيار الجزء الذي يحتوي على الوجه الذي تريد
",
  "reply_to_message_id"=>$message_id,
  "reply_markup"=>json_encode([
    'keyboard'=>[
      [['text'=>'رجوع 🔙']],
      [['text'=>'الجزء الثاني'],['text'=>'الجزء الأول']],
      [['text'=>'الجزء الرابع'],['text'=>'الجزء الثالث']],
      [['text'=>'الجزء السادس'],['text'=>'الجزء الخامس']],
      [['text'=>'الجزء الثامن'],['text'=>'الجزء السابع']],
      [['text'=>'الجزء العاشر'],['text'=>'الجزء التاسع']],
      [['text'=>'الجزء الثاني عشر'],['text'=>'الجزء الحادي عشر']],
      [['text'=>'الجزء الرابع عشر'],['text'=>'الجزء الثالث عشر']],
      [['text'=>'الجزء السادس عشر'],['text'=>'الجزء الخامس عشر']],
      [['text'=>'الجزء الثامن عشر'],['text'=>'الجزء السابع عشر']],
      [['text'=>'الجزء العشرون'],['text'=>'الجزء التاسع عشر']],
      [['text'=>'الجزء الثاني و العشرون'],['text'=>'الجزء الحادي و العشرون']],
      [['text'=>'الجزء الرابع و العشرون'],['text'=>'الجزء الثالث و العشرون']],
      [['text'=>'الجزء السادس و العشرون'],['text'=>'الجزء الخامس و العشرون']],
      [['text'=>'الجزء الثامن و العشرون'],['text'=>'الجزء السابع و العشرون']],
      [['text'=>'الجزء الثلاثون'],['text'=>'الجزء التاسع و العشرون']],
   ],
     'resize_keyboard'=>true
   ])
  ]);
  return;
}

if(in_array($save,$soundafter)){
  $get = json_decode(file_get_contents("https://telegramlibrary.aba.vg/curl/handler.php?soura=".urlencode($text)."&readernameEngilsh=".$save));
  bot('sendaudio',[
    'chat_id' => $chat_id,
    'audio' => $get->url,
    'caption' =>
    "🕋 ".$get->soura."\n🎙 ".$get->readername."\n",
    "reply_to_message_id"=>$message_id,
  ]);
  return;
}

//         End

/*if($text == 'back' and $backsound == 'on'){
  foreach($startsounds as $key){
    $keyboard[] = [$key];
  }
  bot("sendMessage",[
    "chat_id"=>$chat_id,
    "text"=>"
     حياك الله في خدمة الباحث القرآني

     خدمة الباحث القرآني على الانترنت :
    ".$site,
    "reply_to_message_id"=>$message_id,
    "reply_markup"=>json_encode([
      'keyboard'=>$keyboard
  ])
]);
  return;
}

if($text == 'back' and $backhome == 'on'){
  foreach($sound as $ckey){
    $keyboard[] = [$ckey];
  }
  bot("sendMessage",[
    "chat_id"=>$chat_id,
    "text"=>"اختر احد الجزء
    ".$site,
    "reply_to_message_id"=>$message_id,
    "reply_markup"=>json_encode([
      'keyboard'=>$keyboard
    ])
  ]);
  return;
}
*/

if($message){
  bot("sendMessage",[
    "chat_id"=>$chat_id,
    "text"=>"
     لم أتمكن من فهم هذا الأمر ، يرجى إرسال

     /start
   ",
   "reply_to_message_id"=>$message_id,
  ]);
}

?>


Usually, this can be solved by writing a GUI front-end that builds a command line. At that point you simply call the old CLI "main()" function with the arguments in the appropriate order.

What you need to do then, depends on the output. You might do well by wrapping all printf()'s in a generic output variadic function, that in the CLI version will just pass control to printf while in the GUI version sends output to a scrolldown log window or something like that.

This way, the CLI application is mostly unchanged and the GUI front-end, while losing in efficiency, remains loosely coupled and can be maintained independently (in some cases, a mockup - or even a real alternative to the GUI - might be an independent application that then spawns the CLI binary with the proper arguments; sort of what you can do with AutoIt on Windows, so to speak).

But this strongly depends on what the application actually does. This approach can still be pursued to a greater or lesser extent, but it might become awkward if, for example, you wanted to execute the CLI routine cyclically or something like that; or if the program expected to operate on an input from stdin.
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
#uploading our cleaned and merged dataset 
import pandas as pd 
df21 = pd.read_csv('/content/df_joinedCovidCases.csv')
df21
function Feature({title, image, description}: FeatureItem) {
  return (
    <div className={clsx('col col--4')}>
      <div className="text--center">
        <img className={styles.featureSvg} alt={title} src={image} />
      </div>
      <div className="text--center padding-horiz--md">
        <h3>{title}</h3>
        <p className={styles.justifyText}>{description}</p>
      </div>
    </div>
  );
}
# Versions of Pandas >= 1.3.0:
writer = pd.ExcelWriter('output.xlsx',
                        engine='xlsxwriter',
                        engine_kwargs={'options': {'strings_to_numbers': True}})

# Versions of Pandas < 1.3.0:
writer = pd.ExcelWriter('output.xlsx',
                        engine='xlsxwriter',
                        options={'strings_to_numbers': True})
Black: (0, 0, 0)
White: (255, 255, 255)
Red: (255, 0, 0)
Green: (0, 255, 0)
Blue: (0, 0, 255)
Aqua: (0, 255, 255)
Fuchsia: (255, 0, 255)
Maroon: (128, 0, 0)
Navy: (0, 0, 128)
Olive: (128, 128, 0)
Purple: (128, 0, 128)
Teal: (0, 128, 128)
Yellow: (255, 255, 0)
animals = ['cat', 'dog', 'rabbit', 'horse']

# get the index of 'dog'
index = animals.index('dog')


print(index)

# Output: 1
function voorAccordion1() {

if (document.getElementById("nodeLong1")) { // if this ID is there the Node boxes become small
document.getElementById("nodeLong1").style.animation = "LangNaarKort 0.5s linear 1 normal forwards"; // Animation for Node button to become smaller

document.getElementById("close-button").style.animation = "closeButton 0.5s linear 1 normal forwards"; // Close button becomes visible, to close all nodes agian to use the menu again.

document.getElementById("menu1").style.animation = "buttonsUp1 0.5s linear 1 normal forwards"; // Menu buttons go up out of the screen to make place for information inside node
document.getElementById("menu2").style.animation = "buttonsUp1 0.5s linear 1 normal forwards";
document.getElementById("menu3").style.animation = "buttonsUp2 0.5s linear 1 normal forwards";
document.getElementById("menu4").style.animation = "buttonsUp3 0.5s linear 1 normal forwards";


setTimeout(hiddencheck1, 500);
function hiddencheck1() {
document.getElementById("menu1").style.visibility = "hidden"; // Making menu buttons invisible when thir out of the screen so they don't reapear after clicking on acordions again because the animation goes off again after pressing a node again
document.getElementById("menu2").style.visibility = "hidden";
document.getElementById("menu3").style.visibility = "hidden";
document.getElementById("menu4").style.visibility = "hidden";
}

}

if (document.getElementById("nodeLong1")) {
document.getElementById("accordion1").style.visibility = "visible"; //Tab becomes visible again if they were invisible and make other tabs invisible so it doesn't overlap the current Tab
document.getElementById("accordion1").style.animation = "accordions 0.5s linear 1 normal forwards"; // Animation for information that has to come in the screen

document.getElementById("accordion2").style.animation = "accordions 0.5s linear 1 normal forwards"; // these also already get in the screen with an animation but their hidden, but that makes it faster to switch to these items
document.getElementById("accordion3").style.animation = "accordions 0.5s linear 1 normal forwards";

document.getElementById("accordion2").style.visibility = "hidden"; // making sure the other information items stay hidden because else you can't see accordion1 since they overlap
document.getElementById("accordion3").style.visibility = "hidden";
}
}
//first rap app component with <AuthContextProvider>

const { isLoggedIn } = useContext(AuthContext);

  let routes;

  if (isLoggedIn) {
    routes = (
      <Routes>
        <Route exact path="/" element={<Users />} />
        <Route exact path="/:userId/places" element={<UserPlaces />} />
        <Route exact path="/places/new" element={<NewPlace />} />
        <Route exact path="/places/:placeId" element={<UpdatePlace />} />
        <Route path="*" element={<Navigate to="/" />} />
      </Routes>
    );
  } else {
    routes = (
      <Routes>
        <Route exact path="/" element={<Users />} />
        <Route exact path="/:userId/places" element={<UserPlaces />} />
        <Route exact path="/auth" element={<Auth />} />
        <Route path="*" element={<Navigate to="/auth" />} />
      </Routes>
    );
  }


  return (
    <Router>
      <MainNavigation />
      <main>
        {routes}
      </main>
    </Router >
  );
}

export default App;
//=======================================================
auth-context file

// import { createContext } from 'react';

// export const AuthContext = createContext({
//   isLoggedIn: false,
//   login: () => {},
//   logout: () => {}
// });


import React, { createContext, useCallback, useState } from 'react';

export const AuthContext = createContext();

const AuthContextProvider = (props) => {

  const [isLoggedIn, setIsLoggedIn] = useState(false);

  const login = useCallback(() => {
    setIsLoggedIn(true);
  }, []);

  const logout = useCallback(() => {
    setIsLoggedIn(false);
  }, []);

  return (

    <AuthContext.Provider value={{ isLoggedIn: isLoggedIn, login: login, logout: logout }}>
      {props.children}

    </AuthContext.Provider>
  );
}

export default AuthContextProvider;
REST_FRAMEWORK = {
    'DEFAULT_PERMISSION_CLASSES': [
        'rest_framework.permissions.IsAuthenticated',
    ]
}

REST_FRAMEWORK = {
    'DEFAULT_PERMISSION_CLASSES': [
        'rest_framework.permissions.AllowAny',
    ]
}
Object.entries(myObject).forEach(([key, value]) => {
  
});
from linearmodels import PooledOLS
import statsmodels.api as sm
from linearmodels import PanelOLS 
from linearmodels import RandomEffects
condition ? result1 : result2
let greeting = "Hello"; // 'let' means the variable can be reassigned

const question = "How are you?"; // 'const' means the variable cannot be reassigned
if (greeting === "Hello" && question === "What's the time?") {
console.log("It is 10 'o'clock.");
}
else if (greeting === "Hello" || question === "What is the weather like
tomorrow?") {
console.log("It will be sunny tomorrow.");
}
else {
console.log("I don't understand the question.");
}
let classMarks = [62,88,90,70,69,85];
for (i=classMarks.length-1; i >= 0; i--) {
console.log(classMarks[i]);
} // outputs each element reversed
for (let number of classMarks) {
console.log(number);
} // outputs each element
classMarks.forEach(function(number) {
console.log(number+2);
}); // adds 2 to each number and outputs it
let counter = 0;

let j = 0;
while (counter <= 4) {
console.log(classMarks[j]);
counter ++;
j++
} // outputs the first 5 elements in the array
let teachers = new Map();
teachers.set("grade 1", "Mrs Johnson");
teachers.set("grade 2", "Mr Bennett");
for (let [key, value] of teachers) {
console.log(key + ' = ' + value);
}
// grade 1 = Mrs Johnson
// grade 2 = Mr Bennett
for (let key of teachers.keys()) {
console.log(key);
}
// grade 1
// grade 2
for (let value of teachers.values()) {
  console.log(value);
}
// Mrs Johnson
// Mr Bennett
for (let [key, value] of teachers.entries()) {
console.log(`The ${key} teacher is ${value}.`);
}
// grade 1 = Mrs Johnson
// grade 2 = Mr Bennett
function doubleNumber(number) {
return number * 2;
}

console.log(doubleNumber(10)); // outputs 20
function closeDoc(){
alert("You are closing this page!");
window.close();
}
<div class="Buttonbg">
  <p id="txt">Text</p>
</div> 
.Buttonbg {
  width: 356px;
  height: 128px;
  background-color: purple;
  border-radius: 25px;
}

#txt {
  font-family:Simonetta;
	text-align:left;
	font-size:48px;
	letter-spacing:0;
  color:white;
	width:87px;
	height:60px;
	position:absolute;
	left:145px;
	top:-1px;
} 
ac placerat vestibulum lectus mauris ultrices eros in cursus turpis massa tincidunt dui ut ornare lectus sit amet est placerat in egestas erat imperdiet sed euismod nisi porta lorem mollis aliquam ut porttitor leo a diam sollicitudin tempor id eu nisl nunc mi ipsum faucibus vitae aliquet nec ullamcorper sit amet risus nullam eget felis eget nunc lobortis mattis aliquam faucibus purus in massa tempor nec feugiat nisl pretium fusce id velit ut tortor pretium viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare suspendisse sed nisi lacus sed viverra tellus in hac habitasse platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus at augue eget arcu dictum varius duis at consectetur lorem donec massa sapien faucibus et molestie ac feugiat sed lectus vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa eget egestas purus viverra accumsan in nisl nisi scelerisque eu ultrices vitae auctor eu augue ut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio ut sem nulla pharetra diam sit amet nisl suscipit adipiscing bibendum est ultricies integer quis auctor elit sed vulputate mi sit amet mauris commodo quis imperdiet massa tincidunt nunc pulvinar sapien et ligula ullamcorper malesuada proin libero nunc consequat interdum varius sit amet mattis vulputate enim nulla aliquet porttitor lacus luctus accumsan tortor posuere ac ut consequat semper viverra nam libero justo laoreet sit amet cursus sit amet dictum sit amet justo donec enim diam vulputate ut pharetra sit amet aliquam id diam maecenas ultricies mi eget mauris pharetra et ultrices neque ornare aenean euismod elementum nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus mattis rhoncus urna neque viverra justo nec ultrices dui sapien eget mi proin sed libero enim sed faucibus turpis in eu mi bibendum neque egestas congue quisque egestas diam in arcu cursus euismod quis viverra nibh cras pulvinar mattis nunc sed
<!DOCTYPE html>
<html lang="{{ locale }}" dir="{{ direction }}" class="{{ checkout_html_classes }}">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, height=device-height, minimum-scale=1.0, user-scalable=0">
    <meta name="referrer" content="origin">

    <title>{{ page_title }}</title>

    {{ content_for_header }}

    {{ checkout_stylesheets }}
    {{ checkout_scripts }}
  	{{ '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js' | script_tag }}






<!-- GSSTART Slider code start. Do not change -->{% if product.id > 1 %}
<script type="text/javascript" src="https://gravity-software.com/js/shopify/slider_shop32535.js?v=388f5b46548afe106957dda747648b36"></script> 
 {% if product.variants.size > 1 %}<script>
gsSliderDefaultV = "{{ product.selected_or_first_available_variant.id }}";
var variantImagesByVarianName = {};
var variantImagesByVarianNameMix = {};
 var variantImagesGS = {},
    thumbnails,
    variant,
    variantImage,
    optionValue,
    cntImages;
    productOptions = [];
    cntImages = 0;
    {% for variant in product.variants %}
       variant = {{ variant | json }};
       if ( typeof variant.featured_image !== 'undefined' && variant.featured_image !== null ) {
         variantImage =  variant.featured_image.src.split('?')[0].replace(/http(s)?:/,'');
         variantImagesGS[variant.id] = variantImage;
         variantImagesByVarianName[variant.option1] = variantImage;
var variantMixName = "";
if(variant.option1 != null) {
variantMixName = variant.option1;
}
	 if(variant.option2 != null) {
		variantImagesByVarianName[variant.option2] = variantImage;
		variantMixName = variantMixName + ";gs;" + variant.option2;
	 }
         if(variant.option3 != null) {
                variantImagesByVarianName[variant.option3] = variantImage;
		variantMixName = variantMixName + ";gs;" + variant.option3;
         }

if(variantMixName != "") {
variantImagesByVarianNameMix[variantMixName] = variantImage;
}

         cntImages++;
       }
    {% endfor %}
                if(cntImages == 0) {
          variantImagesGS = undefined;
                }
</script> {% endif %}
<script>

var imageDimensionsWidth = {};
var imageDimensionsHeight = {};
var imageSrcAttr = {};
var altTag = {};  

var mediaGS = [];  
  var productImagesGS = [];
var productImagesGSUrls = [];
{% for image in product.images %}
  var productImageUrl = "{{ image.src }}";
  var dotPosition = productImageUrl.lastIndexOf(".");
  productImageUrl = productImageUrl.substr(0, dotPosition);
  productImagesGS.push(productImageUrl);
  imageDimensionsWidth[{{ image.id }}] = "{{ image.width }}";
  imageDimensionsHeight[{{ image.id }}] = "{{ image.height }}";
  altTag[{{ image.id }}] = "{{ image.alt | replace: '\"', '"' | replace: '"', '\"' | strip | strip_newlines }}";
  imageSrcAttr[{{ image.id }}] = "{{ image.src }}";
  productImagesGSUrls.push("{{ image.src | img_url: '240x' }}");
{% endfor %}

{%- for media in product.media -%}
    {% case media.media_type %}
	{% when "image" %}                           
                           var mediaObjectGS ={id: "{{ media.image.id  }}", mediaType:"{{ media.media_type }}", previewImgURL:"{{ media.image.src | img_url: "240x" }}", previewImg:"{{ media.image.src }}", tag:"{{ media.image.src | img_url: "240x" }}"};  
            mediaGS.push(mediaObjectGS);
    {% when "video" %}
              var productImageUrl = "{{ media.preview_image }}";
  var dotPosition = productImageUrl.lastIndexOf(".");
  productImageUrl = productImageUrl.substr(0, dotPosition);                     
  var mediaObjectGS ={id: "{{ media.id }}", mediaType:"{{ media.media_type }}", width: "{{ media.preview_image.width }}", height: "{{ media.preview_image.height }}", previewImgURL:"{{ media.preview_image | img_url: "500x" }}", previewImg:"" + productImageUrl +  "", tag:'{{ media | video_tag: controls: true }}'};                                  
            mediaGS.push(mediaObjectGS);                                
	{% when "external_video" %}                
              var productImageUrl = "{{ media.preview_image }}";
  var dotPosition = productImageUrl.lastIndexOf(".");
  productImageUrl = productImageUrl.substr(0, dotPosition);                     
            var mediaObjectGS ={id: "{{ media.id }}", mediaType:"{{ media.media_type }}", width: "{{ media.preview_image.width }}", height: "{{ media.preview_image.height }}", previewImgURL:"{{ media.preview_image | img_url: "500x" }}", previewImg:"" + productImageUrl +  "", tag:'{{ media | external_video_tag }}'};                                  
            mediaGS.push(mediaObjectGS);
    {% endcase %}
{%- endfor -%}      
                    

</script>

{% endif %}<!-- Slider code end. Do not change GSEND --></head>
  <body>
    {{ skip_to_content_link }}

    <header class="banner" data-header role="banner">
      <div class="wrap">
        {{ content_for_logo }}
      </div>
    </header>

    {{ order_summary_toggle }}
    <div class="content" data-content>
      <div class="wrap">
        <div class="main">
          <header class="main__header" role="banner">
            {{ content_for_logo }}
            {{ breadcrumb }}
            {{ alternative_payment_methods }}
          </header>
          <main class="main__content" role="main">
            {{ content_for_layout }}
          </main>
          <footer class="main__footer" role="contentinfo">
            {{ content_for_footer }}
          </footer>
        </div>
        <aside class="sidebar" role="complementary">
          <div class="sidebar__header">
            {{ content_for_logo }}
          </div>
          <div class="sidebar__content">
            <h2><b>All discounted products and products eligible for promotion are FINAL SALE.</b></h2><br>
            &nbsp;&nbsp;
            {{ content_for_order_summary }}
          </div>
        </aside>
      </div>
    </div>
    
    <div class="data" style="display:none;">
      <span class="taxAmount">{{ checkout.tax_price | money_without_currency | remove: ',' }}</span>
      <span class="grandTotal">{{ checkout.total_price | money_without_currency | remove: ',' }}</span>
      <span class="currency">{{ shop.currency }}</span>

      {% for line_item in checkout.line_items %}
            <div class="lineItem">
              <span class="compareAtPrice">{{ line_item.variant.compare_at_price | money_without_currency | remove: ',' }}</span>
            </div>
      {% endfor %}
    </div>
    
    {% for line_item in checkout.line_items %}
        {% if line_item.variant.compare_at_price > line_item.variant.price %}
        <s>{{ line_item.variant.compare_at_price | money }}</s>
        {% endif %}
  	{% endfor %}
    
    {% comment %}
    {% assign hasItem = false %}
    {% assign itm = false %}
    {%- for line_item in cart.items -%}
        {% if line_item.variant_id == '40125709287583' %}
	        {% assign hasItem = true %}	
        {% endif %}
    
    	{% if line_item.product.tags contains 'COLLECTION_CLEARANCE' %}
	        {% assign itm = true %}	
    	{% endif %}
    {%- endfor -%}
    <script>
      console.log('{{itm}}');
      console.log('{{hasItem}}');
      {% if hasItem == false %}
      var xhr = new XMLHttpRequest();
      xhr.open("POST", '/cart/add.js', true);
      xhr.setRequestHeader('Content-Type', 'application/json');
      xhr.send(JSON.stringify({
        items: [
          {
            quantity: 1,
            id: 40125709287583
          }
        ]
      }));
      {% endif %}
      /*
      var xhttp = new XMLHttpRequest();
      xhttp.onreadystatechange = function() {
        if (this.readyState == 4 && this.status == 200) {
          cart = JSON.parse(this.responseText);          
          var lineitems = cart.items;
          lineitems.forEach(function(item, index){
            console.log(item.handle);
            var xhttp1 = new XMLHttpRequest();
            xhttp1.onreadystatechange = function() {
              if (this.readyState == 4 && this.status == 200) {
				var product = JSON.parse(this.responseText);                
                if(product.tags.includes("COLLECTION_CLEARANCE")){
                  var xhr = new XMLHttpRequest();
                  xhr.open("POST", '/cart/add.js', true);
                  xhr.setRequestHeader('Content-Type', 'application/json');
                  xhr.send(JSON.stringify({
                    items: [
                      {
                        quantity: 1,
                        id: 40125709287583
                      }
                    ]
                  }));
                }
                
              }
            };
            xhttp1.open("GET", "/products/"+ item.handle + ".js", true);
            xhttp1.send();          
          });          
        }
      };
      xhttp.open("GET", "/cart.js", true);
      xhttp.send();
      */
      
    </script>
    {% endcomment %}

    {{ tracking_code }}
  <link rel="stylesheet" href="https://gravity-software.com/js/shopify/rondell/jquery.rondellf85.css?v=123"/>
    
  <script type="text/javascript">
    $(function() {
      	  var priceArry = [];
          $('.data .lineItem').each(function(key, data) {
            //console.log(data);
            var compareAtPrice = $(this).find('.compareAtPrice').text();
            //console.log(compareAtPrice);
            priceArry.push(compareAtPrice);
            
          });
          
          //console.log(priceArry);
          
          $('.product-table > tbody  > tr').each(function(product_index, tr) { 
             console.log(product_index);
             console.log(tr);
             var priceDiv = $(tr).find(".product__price");
              $.each(priceArry, function(compare_price_index, compare_price ) {
                console.log(compare_price_index);
                console.log(compare_price);
                if(compare_price && product_index == compare_price_index){
                  $(priceDiv).append("<span class='order-summary__emphasis skeleton-while-loading' style='text-decoration: line-through;'>$"+compare_price+'</span>');
                }
                return; 
              });
             
          });
          
    });
  </script>
  </body>
</html>
#creating a merged dataset for stringency index and covid cases (df_joinedCovidCases) and cleaning it
df_joinedCovidCases=pd.merge(df3, df_joinedQGDP,on=["Date","CountryName"])
df_joinedCovidCases=df_joinedCovidCases.sort_values('Date',ascending=True)
df_joinedCovidCases=df_joinedCovidCases.reset_index(drop=True)
df_joinedCovidCases=df_joinedCovidCases.dropna()
df_joinedCovidCases
.header-overlay--is-opened .rey-overlay--header, .site-overlay--is-opened .rey-overlay--site, .rey-overlay .rey-overlay--header{
	display:none !important;
}
/*Change by Itai
 * */
/*swatches colors*/
.wvs-no-css.wvs-style-rounded .rey-quickviewPanel .variable-items-wrapper .variable-item.color-variable-item,
.wvs-no-css.wvs-style-rounded .variable-items-wrapper .variable-item.color-variable-item {
	border:none !important;
	padding:2px !important;
}
/* quickview product price*/
.woocommerce div.product p.price {
	font-family: "Montserrat-l";
	font-weight: 400;
	color: var(--e-global-color-text);
}

body #wfacp-e-form .wfacp_main_form .wfacp-payment-dec,
.elementor-2005 .elementor-element.elementor-element-d2b744e #wfacp-e-form .wfacp_main_form .wfacp-payment-dec {display: flex;
    align-items: start;
    justify-content: center;
    font-size: 12px;
    background: transparent;
    margin: 0;
    color: var( --e-global-color-db63008 );
}
body #wfacp-e-form .wfacp_main_form .wfacp-payment-dec img,
.elementor-2005 .elementor-element.elementor-element-d2b744e #wfacp-e-form .wfacp_main_form .wfacp-payment-dec img{margin-right:5px; }


/* Updates by Itai
 * Nov 25
 * */
.woocommerce-message, .woocommerce-error, .woocommerce-info { background-color : inherit !important; }
/*wishlist add to cart product page*/
.woocommerce .rey-wishlistBtn.--btn-text {
    font-size: 13px;
    border-style: solid !important;
    border-width: 2px !important;
    border-color: var( --e-global-color-db63008 ) !important;
    border-radius: 60px !important;
    padding: 10px !important;
}
.woocommerce ul.products li.product .button.rey-btn--primary-out{
 border-width: 2px !important;
 border-radius: 0px;
}
@media(max-width:1025px){
.woocommerce ul.products li.product .button.rey-btn--primary-out{
    color: var( --e-global-color-2139cce ) !important;
background-color: var( --e-global-color-db63008 ) !important;
border-color:var( --e-global-color-db63008 );;
}
}
.woocommerce ul.products li.product .button.rey-btn--primary-out:hover{
border-color:var( --e-global-color-db63008 );;
}
/*swatches colors*/
.wvs-no-css.wvs-style-rounded .variable-items-wrapper .variable-item.color-variable-item {
	border:none  !important;
	padding:2px !important;
}
.rey-swatchList .rey-swatchList-item--regular {
	box-shadow: none !important;
	padding: 0 !important;
	background-color: transparent  !important;
}
.woo-variation-swatches .variable-items-wrapper .variable-item:not(.radio-variable-item) {
    box-shadow: none !important;
	
}
.woo-variation-swatches .variable-items-wrapper .variable-item:not(.radio-variable-item).selected {
    background-color: transparent !important;
}
div.qty {
    float: left;
    padding-bottom: 10px;
    font-weight: 500;
}
.wvs-no-css .variable-items-wrapper .variable-item:not(.radio-variable-item) {
	background-color: transparent;
}
/*product prcining*/
.woocommerce div.product p.price {
	font-family: "Montserrat-l" !important;
	font-weight: 400;
	color: var(--e-global-color-text);
}
/*quick view*/
.woocommerce.single-skin--default div.product div.summary {
	background-color: #FCF8F2;
}
.rey-quickviewPanel.woocommerce .rey-quickviewPanel-close {
    color: black !important;
}
.rey-quickviewPanel.woocommerce .rey-quickview-container {
	-webkit-box-shadow: 0px 3px 6px #0000004D;
	box-shadow: 0px 3px 6px #0000004D;
}
.rey-productSummary div.summary.entry-summary div.summary-inner.js-scrollbar.ss-container div.ss-wrapper div.ss-content div.rey-innerSummary p.price {
    border-bottom: 2px solid rgba(87, 63, 76, 0.8) !important;
}
.rey-productSummary div.summary.entry-summary div.summary-inner.js-scrollbar.ss-container div.ss-wrapper div.ss-content div.rey-innerSummary div.woocommerce-product-rating {
    display: none;
}
/*product page*/
.quantity {
    display: flex;
    width: 100%;
    margin-bottom: 15px;
}
/* checking checkout*/
#wfacp-e-form .wfacp_main_form.woocommerce .wfacp_section_title {     border-color: var( --e-global-color-accent );}

body #wfacp-e-form .wfacp_main_form .wfacp-payment-dec,.elementor-2005 .elementor-element.elementor-element-d2b744e #wfacp-e-form .wfacp_main_form .wfacp-payment-dec {display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: transparent;
    margin: 0;
    color: var( --e-global-color-db63008 );
}
body #wfacp-e-form .wfacp_main_form .wfacp-payment-dec img,
.elementor-2005 .elementor-element.elementor-element-d2b744e #wfacp-e-form .wfacp_main_form .wfacp-payment-dec img{margin-right:5px; }
@media (max-width:1024px) {
    .woocommerce .rey-cartBtnQty div.quantity {
    margin-bottom:20px;
}
}
/*wishlist ti*/
.woocommerce div.product form.cart .tinv-wishlist {
    border-style: solid !important;
    border-width: 2px !important;
    border-color: var( --e-global-color-db63008 ) !important;
    border-radius: 60px !important;
}

.rey-cartPanel-wrapper.rey-sidePanel{
	z-index:9999 !important;
}

/* Updates 
 * by
 *  Tanmay Bagadiya*/
/* Inside Index Page in About Us Section */
<center><div class="about_us_collection">10% Off  </br> Your Collection Order</div></center>
</br>

/* In HeadHTML Section */
.about_us_collection{
background:#1f1f1f!important;
text-align:center;
color:#fff!important;
width:50%!important;
}
@media only screen and (max-width: 524px){
div.about_us_collection{
width:100%!important;
}
}
# mongodb
POSTGRESQL_NAME=larnu-business
POSTGRESQL_USER=larnu_user
POSTGRESQL_PASSWORD=cmJ2w9fEOgw5MdLe
POSTGRESQL_HOST=34.95.139.180
POSTGRESQL_PORT=5432

<!DOCTYPE html>
<html>
 <head>
  <title>Comment System front end & back end</title>

<link rel="stylesheet" href="LAC.css" >
 </head>
 <body>
<div>
     <h2>comment section using PHP and Html</h2>
    <div>
    <form id="form">
        <label>Name</label>
        <input type="text"  placeholder="enter name" id="name">
        <br><br>
        <label>Message</label>
        <input type="text" placeholder="enter message" id="message">
        </form>
        <br>
        <button type="button" id="btn">send comment</button>
    </div>
     </div>
     <div id="content"></div>
     

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


    <script>
        $(document).ready(function(){
            function loadData(){
                $.ajax({
                    url: 'select-data.php',
                    type: 'POST',
                    success: function(data){
                        $("#content").html(data);
                    }
                });
            }

            loadData();

            $("#btn").on("click", function(e){
                e.preventDefault();
                var name = $("#name").val();
                var message = $("#message").val();

                $.ajax({
                    url: 'insert-data.php',
                    type: 'POST',
                    data: {name: name, message: message},
                    success: function(data){
                        if (data == 1) {
                            loadData();
                            alert('Comment Submitted Successfully');
                            $("#form").trigger("reset");
                        }else {
                            alert("Can not submite comment.");
                        }
                    }
                });
            });
        });
    </script>

    
</html>
<?php
    $servername = "localhost:3308";
    $username = "root";
    $password = "";
    $database = "html+css";
    $port = "3308";

    $conn = mysqli_connect($servername, $username, $password, $database , $port);

    if (!$conn) {
        echo "Connection Failed.";
    }
?>
body{
    font-family: cursive;
    text-align: center;
    margin: 0;
    padding: 0;
}
body h2{
    font-size: 40px;
    text-align: center;
}
form{
    text-align: center;
    font-size: 20px;
    
}
button{
    font-size: 18px;
    background-color: aqua;
    border-radius: 30%;
    
}
button:hover{
    cursor: pointer;
    letter-spacing: 3px;
   background-color:#5AC6AC;
    color: white;
    border-color: white;
}
input
{
    height: 25px;
    width: 450px;
    border-color: aqua;
  
    
}
<?php
    include 'config.php';

    $name = $_POST['name'];
    $message = $_POST['message'];
    $date = $_POST['date'];
    
    $sql = "INSERT INTO demo(name, message) VALUES ('$name', '$message')";
    $result = mysqli_query($conn, $sql);

    if ($result) {
        echo 1;
    }else {
        echo 0;
    }
?>
star

Sun Jan 16 2022 12:17:53 GMT+0000 (Coordinated Universal Time)

@armin10020

star

Sun Jan 16 2022 15:08:41 GMT+0000 (Coordinated Universal Time) https://www.odoo.com/documentation/14.0/developer/reference/addons/mixins.html?highlight

@jrund

star

Sun Jan 16 2022 18:27:07 GMT+0000 (Coordinated Universal Time)

@mastaklance

star

Sun Jan 16 2022 19:18:31 GMT+0000 (Coordinated Universal Time)

@confis

star

Sun Jan 16 2022 20:21:36 GMT+0000 (Coordinated Universal Time)

@sapien123

star

Mon Jan 17 2022 00:54:51 GMT+0000 (Coordinated Universal Time) https://www.deployhq.com/git/faqs/removing-large-files-from-git-history

@ainaimi

star

Mon Jan 17 2022 02:17:27 GMT+0000 (Coordinated Universal Time) https://edge.sincar.jp/web/base64-inline-image/

star

Mon Jan 17 2022 03:39:38 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/5242319/what-does-this-mean-image-pngbase64

star

Mon Jan 17 2022 03:58:23 GMT+0000 (Coordinated Universal Time)

@trantrinh

star

Mon Jan 17 2022 04:00:18 GMT+0000 (Coordinated Universal Time)

@chicovirabrikin

star

Mon Jan 17 2022 12:04:20 GMT+0000 (Coordinated Universal Time) https://pandas.pydata.org/docs/reference/api/pandas.ExcelWriter.html

star

Mon Jan 17 2022 12:39:11 GMT+0000 (Coordinated Universal Time)

@LeafFresh

star

Mon Jan 17 2022 15:22:17 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/21058230/how-to-assert-a-dict-contains-another-dict-without-assertdictcontainssubset-in-p

@arielvol

star

Mon Jan 17 2022 15:28:14 GMT+0000 (Coordinated Universal Time) https://www.a11yproject.com/checklist/

@erinksmith

star

Mon Jan 17 2022 18:52:05 GMT+0000 (Coordinated Universal Time) https://startpage.com/sp/search?query

@Bruce_Sloan

star

Mon Jan 17 2022 20:43:51 GMT+0000 (Coordinated Universal Time)

@NinjaGamerlero

star

Mon Jan 17 2022 22:19:04 GMT+0000 (Coordinated Universal Time) https://softwareengineering.stackexchange.com/questions/204225/what-are-some-standard-design-methods-to-add-gui-to-a-command-line-app

@akshay99

star

Tue Jan 18 2022 00:05:01 GMT+0000 (Coordinated Universal Time)

@uclqmli

star

Tue Jan 18 2022 05:47:00 GMT+0000 (Coordinated Universal Time)

@emcie

star

Tue Jan 18 2022 06:21:42 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/41080999/python-df-to-excel-storing-numbers-as-text-in-excel-how-to-store-as-value

star

Tue Jan 18 2022 06:47:00 GMT+0000 (Coordinated Universal Time) https://www.pyimagesearch.com/2021/01/20/opencv-getting-and-setting-pixels/

@vikassnwl

star

Tue Jan 18 2022 09:08:28 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/python-programming/methods/list/index

star

Tue Jan 18 2022 11:50:05 GMT+0000 (Coordinated Universal Time)

@LeafFresh

star

Tue Jan 18 2022 13:20:59 GMT+0000 (Coordinated Universal Time)

@ahmedsalemas

star

Tue Jan 18 2022 14:33:59 GMT+0000 (Coordinated Universal Time)

@Taylor

star

Tue Jan 18 2022 15:16:21 GMT+0000 (Coordinated Universal Time) https://www.reddit.com/r/typescript/comments/gqxh2h/why_is_it_so_hard_to_iterate_over_objects_in/

@ryanvv

star

Tue Jan 18 2022 15:38:23 GMT+0000 (Coordinated Universal Time) https://github.com/Automattic/mongoose/issues/1251

@dsag

star

Tue Jan 18 2022 16:26:26 GMT+0000 (Coordinated Universal Time)

@uclqmli

star

Tue Jan 18 2022 18:27:16 GMT+0000 (Coordinated Universal Time) https://www.tradingview.com/pine-script-docs/en/v4/language/Operators.html

@yasin5255

star

Tue Jan 18 2022 18:57:53 GMT+0000 (Coordinated Universal Time)

@shinesheray

star

Tue Jan 18 2022 19:34:31 GMT+0000 (Coordinated Universal Time)

@shinesheray

star

Tue Jan 18 2022 20:06:45 GMT+0000 (Coordinated Universal Time)

@shinesheray

star

Tue Jan 18 2022 20:46:14 GMT+0000 (Coordinated Universal Time)

@shinesheray

star

Tue Jan 18 2022 20:53:06 GMT+0000 (Coordinated Universal Time)

@shinesheray

star

Tue Jan 18 2022 21:09:34 GMT+0000 (Coordinated Universal Time)

@shinesheray

star

Tue Jan 18 2022 22:04:16 GMT+0000 (Coordinated Universal Time)

@Rangerdevv

star

Tue Jan 18 2022 22:09:20 GMT+0000 (Coordinated Universal Time)

@Rangerdevv

star

Wed Jan 19 2022 00:15:03 GMT+0000 (Coordinated Universal Time)

@frescani

star

Wed Jan 19 2022 03:52:13 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/2845731/how-to-uncommit-my-last-commit-in-git

star

Wed Jan 19 2022 08:42:19 GMT+0000 (Coordinated Universal Time)

@shaikhmasud147

star

Wed Jan 19 2022 10:26:35 GMT+0000 (Coordinated Universal Time)

@uclqmli

star

Wed Jan 19 2022 10:55:11 GMT+0000 (Coordinated Universal Time)

@itaiki

star

Wed Jan 19 2022 12:24:41 GMT+0000 (Coordinated Universal Time)

@hollyhenaghan

star

Wed Jan 19 2022 13:14:26 GMT+0000 (Coordinated Universal Time)

@javier

star

Wed Jan 19 2022 14:35:05 GMT+0000 (Coordinated Universal Time)

@webCycle

star

Wed Jan 19 2022 14:40:09 GMT+0000 (Coordinated Universal Time)

@webCycle

star

Wed Jan 19 2022 14:41:37 GMT+0000 (Coordinated Universal Time)

@webCycle

star

Wed Jan 19 2022 14:43:55 GMT+0000 (Coordinated Universal Time)

@webCycle

Save snippets that work with our extensions

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