Snippets Collections
/* direct child */
      div > p{
        font-weight: bold;
        color: #40dad5;
      }
<div>
        <p>Groceries List.</p>
        <ul>
            <li>Green Peas</li>
            <li>Tomatoes</li>
            <li>Onions</li>
            <li>potatoes</li>
            <li>Leafy veggies</li>
        </ul>
</div>
​// added useRef 
import React, { useState, useRef } from 'react';
import {
  IonSegment, IonSegmentButton, IonRow, IonCol, IonGrid, IonContent, IonSlides,
  IonSlide,IonLabel,
} from '@ionic/react';

//import Segment from '../components/Segment';
const Market: React.FC = () => {

  // a ref variable to handle the current slider
  const slider = useRef<HTMLIonSlidesElement>(null);
  // a state value to bind segment value
  const [value, setValue] = useState("0");

  const slideOpts = {
    initialSlide: 0,
    speed: 400,
    loop: false,
    pagination: {
      el: null
    },

  };

  // a function to handle the segment changes
  const handleSegmentChange = (e: any) => {
    if(e.detail.value != null  || e.detail.value != undefined ){
      setValue(e.detail.value);
      slider.current!.slideTo(e.detail.value);
    } 
  };

  // a function to handle the slider changes
  const handleSlideChange = async (event: any) => {
    let index: number = 0;
    await event.target.getActiveIndex().then((value: any) => (index = value));
    setValue('' + index)
  }
 

  return (
    <>

      <IonSegment value={value} onIonChange={(e) => handleSegmentChange(e)} >
      <IonSegmentButton value="0">
          <IonLabel>Message</IonLabel>
        </IonSegmentButton>

        <IonSegmentButton value="1">
          <IonLabel>Favourite</IonLabel>
        </IonSegmentButton>

        <IonSegmentButton value="2">
          <IonLabel>Calls</IonLabel>
        </IonSegmentButton>
      </IonSegment>

      <IonContent>
        {/*-- Market Segment --*/}
        {/*-- the ref method binds this slider to slider variable --*/}
        <IonSlides pager={true} options={slideOpts} onIonSlideDidChange={(e) => handleSlideChange(e)} ref={slider}>
          <IonSlide>
            <IonGrid>
              <IonRow>
                <IonCol>
                  <h1>Masseges</h1>
                  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptate corporis magnam officiis molestias molestiae, sed itaque illum unde inventore animi consequatur aliquam id tempora a libero consectetur ratione eveniet illo harum dignissimos corrupti eaque tempore exercitationem? Voluptatibus ea dolorem quisquam voluptatem, eum ducimus quibusdam veniam, itaque laboriosam placeat, magni aspernatur.</p>
                </IonCol>
              </IonRow>
            </IonGrid>
          </IonSlide>
          {/*-- Package Segment --*/}
          <IonSlide>
            <IonGrid>
              <IonRow>
                <IonCol>
                  <h1>Favourite</h1>
                  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptate corporis magnam officiis molestias molestiae, sed itaque illum unde inventore animi consequatur aliquam id tempora a libero consectetur ratione eveniet illo harum dignissimos corrupti eaque tempore exercitationem? Voluptatibus ea dolorem quisquam voluptatem, eum ducimus quibusdam veniam, itaque laboriosam placeat, magni aspernatur.</p>
                </IonCol>
              </IonRow>
            </IonGrid>
          </IonSlide>

          <IonSlide>
            <IonGrid>
              <IonRow>
                <IonCol>
                  <h1>Calls</h1>
                  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptate corporis magnam officiis molestias molestiae, sed itaque illum unde inventore animi consequatur aliquam id tempora a libero consectetur ratione eveniet illo harum dignissimos corrupti eaque tempore exercitationem? Voluptatibus ea dolorem quisquam voluptatem, eum ducimus quibusdam veniam, itaque laboriosam placeat, magni aspernatur.</p>
                </IonCol>
              </IonRow>
            </IonGrid>
          </IonSlide>
        </IonSlides>
      </IonContent>
    </>
  )
}

export default Market;
/* inside an element */
      div ul li{
        background-color: #512347;
      }

<div>
        <p>Groceries List.</p>
        <ul>
            <li>Green Peas</li>
            <li>Tomatoes</li>
            <li>Onions</li>
            <li>potatoes</li>
            <li>Leafy veggies</li>
        </ul>
</div>
export const blobToBase64 = (url) => {
  return new Promise(async (resolve, _) => {
    const response = await fetch(url);
    const blob = await response.blob();
    const fileReader = new FileReader();
    fileReader.readAsDataURL(blob);

    fileReader.onloadend = function () {
      resolve(fileReader.result);
    };
  });
};

 const croppedImage = await blobToBase64(banner.croppedImage);
/* combined selector */
      span, p{
        background-color: #4da2ec;
        color: #000000;
      }
<body>
    <div>Welcome to live class</div>
    <span >Span is just a span, nothing more</span>
    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quia, eos!</p>
</body>
/* and selector (chained) */
      li.bg-color.text-change{
        background-color: #ecd94d;
        color: #000000;
      }
<body>
     <ul>
        <li class="bg-color text-change">i love strawberries</li>
        <li>i love guava</li>
        <li>i like chocolates</li>
        <li>i like brownies</li>
    </ul>    
</body>
create or replace trigger "ASSESSMENT_RESULTS_T1"
AFTER
insert on "ASSESSMENT_RESULTS"
for each row
begin
INSERT INTO ACTIONS 
(REPORT_ID,QUESTION,SCORE,MIN_SCORE,MAX_SCORE,FINAL_SCORE,COMMENTS)
SELECT REPORT_ID,QUESTION_ID,SCORE,MIN_SCORE,MAX_SCORE,(SCORE*100/MAX_SCORE) AS FINAL_SCORE,COMMENTS 
FROM (select a.*,max(rowid) over () as max_pk from assessment_results a)
where rowid = max_pk;
end;
/   
sequelize
  .sync({ force: true })
  .then(result => {
    app.listen(3000);
  })
  .catch(err => {
    console.log(err);
  });
const Sequelize = require('sequelize');

const sequelize = require('../util/database');

const Product = sequelize.define('product', {
  id: {
    type: Sequelize.INTEGER,
    autoIncrement: true,
    allowNull: false,
    primaryKey: true
  },
  title: Sequelize.STRING,
  price: {
    type: Sequelize.DOUBLE,
    allowNull: false
  },
  imageUrl: {
    type: Sequelize.STRING,
    allowNull: false
  },
  description: {
    type: Sequelize.STRING,
    allowNull: false
  }
});

module.exports = Product;
const Sequelize = require('sequelize');

const sequelize = new Sequelize('node_complete', 'root', 'Dgsh@12345', {
  dialect: 'mysql',
  host: 'localhost'
});

module.exports = sequelize;
 <IonSlides >
            {(selected === 'message') && (
              <IonSlide>
                <h1>Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium repellendus, porro doloribus aut hic fugiat in debitis sed quae exercitationem.</h1>
              </IonSlide>
            )}
            {(selected === 'favourite') && (
              <IonSlide>
                <h1>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Praesentium eveniet eos id corporis debitis ex.</h1>
              </IonSlide>
            )}
            {(selected === 'favourite') && (
              <IonSlide>
                <h1>Lorem ipsum dolor sit amet consectetur adipisicing elit. Nemo, magni.</h1>
              </IonSlide>
            )}
          </IonSlides>
<style>
.w-slider-dot {
  background: #ffffff;
}
.w-slider-dot.w-active {
  background: #004411;
}
</style>
/* Script to close video popup modal */
<script>
    $(function() {
  $('.open-modal').click(function() {
    $('.modal').fadeIn();
    $('.modal-background').fadeIn();
    e.stopPropagation();
  });
  $('.close-modal').click(function() {
      $('.modal').fadeOut();
      $('.modal-background').fadeOut();
  });  
  $('.modal-background').click(function() {
      $('.modal').fadeOut();
      $('.modal-background').fadeOut();
  }); 
  $(document).keydown(function (event) {
      if (event.keyCode == 27) {
          $('.modal').fadeOut();
          $('.modal-background').fadeOut();
      }
  });
});
</script>
/* class and id selector */
      .bg-color{
            background-color: #838ced;
            color:#ffffff;
      }
		#alert{
        background-color: #c21212;
        color: #ffffff; 
      }
<body>
    <div>Welcome to live class</div>
    <span class="bg-color" id="alert">Span is just a span, nothing more</span>
    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quia, eos!</p>
</body>
<head>
<style>
         /* universal selector */
      *{
        background-color: #191418;
        color: #ffffff;
      }
      /* individual selector */
      p{
        color:#c4971b;
      }
    </style>
</head>
<body>
    <div >Welcome to live class</div>
    <span >Span is just a span, nothing more</span>
    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quia, eos!</p>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
         /* universal selector */
      *{
        background-color: #bd7cb0;
        color: #ffffff;
      }
    </style>
</head>
<body>
    <div >Welcome to live class</div>
    <span >Span is just a span, nothing more</span>
    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quia, eos!</p>
</body>
</html>
select c001 "action", c002 "assigned_to" , c003 "root_cause_analysis" , c004 "status", c006 "question",
       n001 "id", n005 "score",d001 "completion_date"
       from APEX_COLLECTIONS where collection_name = 'CORRECTIVE_ACTIONS';
begin

     if NOT APEX_COLLECTION.COLLECTION_EXISTS(p_collection_name=>'CORRECTIVE_ACTIONS') then
            APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION(
                p_collection_name =>'CORRECTIVE_ACTIONS'
            );
    end if;
IF :P41_REPORT_ID IS NULL THEN

        for i in 
                (
                    SELECT C.ID,
                    C.ACTION, 
                    C.ASSIGNED_TO,
                    C.COMPLETION_DATE,
                    C.STATUS,
                    C.REPORT_ID,
                    C.ROOT_CAUSE_ANALYSIS,
                    A.QUESTION_ID, A.SCORE, A.MAX_SCORE , (A.SCORE * 100 / A.MAX_SCORE) AS FINAL_SCORE, A.COMMENTS 
                    FROM ACTIONS C
                    JOIN ASSESSMENT_RESULTS A ON A.REPORT_ID = C.REPORT_ID
                     WHERE A.SCORE <= A.MIN_SCORE
                ) LOOP

                 APEX_COLLECTION.ADD_MEMBER(
                        p_collection_name=>'CORRECTIVE_ACTIONS',
                        p_c001 => i.ACTION,
                        p_c002 => i.ASSIGNED_TO,
                        p_c003 => i.ROOT_CAUSE_ANALYSIS,
                        p_c004 => i.STATUS,
                        p_c005 => i.COMMENTS,
                        p_c006 => i.QUESTION_ID,
                        p_n001 => i.REPORT_ID,
                        p_n002 => i.ID,
                        p_n003 => i.SCORE,
                        p_n004 => i.MAX_SCORE,
                        p_n005 => i.FINAL_SCORE,
                        P_d001 => to_date(i.COMPLETION_DATE)
                       
                    );

             end loop;
 ELSE
    

            for i in 
                    (
                        SELECT C.ID,
                        C.ACTION, 
                        C.ASSIGNED_TO,
                        C.COMPLETION_DATE,
                        C.STATUS,
                        C.REPORT_ID,
                        C.ROOT_CAUSE_ANALYSIS,
                        A.QUESTION_ID, A.SCORE, A.MAX_SCORE , (A.SCORE * 100 / A.MAX_SCORE) AS FINAL_SCORE, A.COMMENTS 
                        FROM ACTIONS C
                        RIGHT JOIN ASSESSMENT_RESULTS A ON A.REPORT_ID = C.REPORT_ID
                        WHERE A.REPORT_ID = :P41_REPORT_ID AND A.SCORE <= A.MIN_SCORE

                    ) LOOP

                     APEX_COLLECTION.ADD_MEMBER(
                            p_collection_name=>'CORRECTIVE_ACTIONS',
                            p_c001 => i.ACTION,
                            p_c002 => i.ASSIGNED_TO,
                            p_c003 => i.ROOT_CAUSE_ANALYSIS,
                            p_c004 => i.STATUS,
                            p_c005 => i.COMMENTS,
                            p_c006 => i.QUESTION_ID,
                            p_n001 => i.REPORT_ID,
                            p_n002 => i.ID,
                            p_n003 => i.SCORE,
                            p_n004 => i.MAX_SCORE,
                            p_n005 => i.FINAL_SCORE,
                            p_d001 => to_date(i.COMPLETION_DATE)
                        );
                end loop;
 end if;
end;
begin

for i in (select c001 "action", c002 "assigned_to" , c003 "root_cause_analysis" , c004 "status", c006 "question",
       n002 "id", n005 "score",d001 "completion_date"
       from APEX_COLLECTIONS where collection_name = 'CORRECTIVE_ACTIONS') LOOP
     iF i.id IS NULL THEN
        insert into ACTIONS 
        ( ACTION, ASSIGNED_TO, COMPLETION_DATE,STATUS,REPORT_ID,ROOT_CAUSE_ANALYSIS )
        values 
        ( i.action, i.assigned_to, i.completion_date, i.status, :P41_REPORT_ID, i.root_cause_analysis);

    ELSE
        update ACTIONS
           set ACTION  =  i.action,
               ASSIGNED_TO = i.assigned_to,
               COMPLETION_DATE =  i.completion_date,
               STATUS = i.status ,
               REPORT_ID =:P41_REPORT_ID,
               ROOT_CAUSE_ANALYSIS = i.root_cause_analysis
         where ID  = i.id;
    end if;
END LOOP;
end;
Convert cubic centimeters to liters. To do this, use the conversion rate {\displaystyle 1\;{\text{liter}}=1,000cm^{3}}
This next example shows how to create an installable open trigger for a spreadsheet. Note that, unlike for a simple onOpen() trigger, the script for the installable trigger does not need to be bound to the spreadsheet. To create this trigger from a standalone script, simply replace SpreadsheetApp.getActive() with a call to SpreadsheetApp.openById(id).
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main()
{
int i, s, n, j = 0, c = 0, c1 = 0;
printf("Enter the number of rows: ");
scanf("%d",&n);
for(i = 1; i <= n; ++i)
{
for(s = 1; s <= n-i; ++s)
{
printf("  ");
++c;
}
while(j != 2 * i - 1)
{
if (c <= n - 1)
{
printf("%d ", i + j);
++c;
}
else
{
++c1;
printf("%d ", (i + j - 2 * c1));
}
++j;
}
c1 = c = j = 0;
printf("\n");
}


    
    
    
    return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main() {
    int num1,num2;
    printf("please enter 2 number");
    scanf("%d %d",&num1,&num2);
    printf("sum is %d\n",num1+num2);
    printf("minus is %d\n",num1-num2);
    printf("product is %d\n",num1*num2);
    printf("division is %d\n",num1/num2);
    
    
    return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

/*ask use to enter three number and determines the maximum amongs on these numbers
and prints the maximum on the screen.*/


int main() {
    int num1,num2,num3;
    printf("please enter 3 number");
    scanf("%d %d %d",&num1,&num2,&num3);
    if(num1>=num2 &&num1>=num3)
    {
        printf("%d",num1);
    }
    else if(num2>=num1 &&num2>=num3)
    {
        printf("%d",num2);
    }
    else
    {
        printf("%d",num3);
    }

    return 0;
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main() {
     float b,h,a;
    printf("please enter base and height; ");
    scanf("%f %f",&b,&h);
    a=1.0/2.0*b*h;
    printf("the area of triangle with base %f and height %f is %f",b,h,a);
        

    return 0;
}
// Online C compiler to run C program online
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

print like this in the output;

XX
XXXX
XXXXXX
XXXXXXXX
XXXXXXXXXX


int main() {
    int line,col;
    for(int line=1;line<=5;line++)
    {
    for(int col=1;col<=line*2;col++)
    {
        printf("X");
    }
    printf("\n");
    }
        
        
        
        
    return 0;
}
return errors.New(fmt.Sprintf("invalid input, unknown animal '%s', usage: newanimal <name> <%s>", kind, strings.Join(validAnimals, "|")))
<h1>Welcome to my website</h1>

<h2>What do I have to offer</h2>

<h3>1. Financial Benefits</h3>

<h3>2. Society improves</h3>

<h4>a. Improving the tax system</h4>

<h4>b. Providing more refuse dumps</h4>

<h2>Who am I</h2>

<h2>Conclusion</h2>
<link rel="stylesheet" href="./style.css">
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>My Website</title>
    <link rel="stylesheet" href="./style.css">
    <link rel="icon" href="./favicon.ico" type="image/x-icon">
  </head>
  <body>
    <main>
        <h1>Welcome to My Website</h1>  
    </main>
	<script src="index.js"></script>
  </body>
</html>
%jdbc(hive)
set tez.queue.name=default;
set hive.execution.engine=tez;

select distinct DATE_SUB('2022-11-11',7) starting_date, DATE_SUB('2022-11-11',1) ending_date
,a.active_days active_days
,'weekly' date_range
,a.identifier identifier
,'avg_vpa_amt' red_flag
,a.amt/a.vpa value
,a.vpa comment
,case when d.identifier is null then 'New' else 'Repeat' end as new_or_repeat
,`group`
,`type`
,type_fra
,issue_type
,sub_issue_type
,'2022-11-11' as run_date from
    (select receiveruser identifier ,count(transaction_id) txn ,sum(totaltransactionamount) amt ,count(distinct sender_vpa) vpa
    ,count(distinct updated_date) active_days
    ,'AML' `group`
    ,'FRA' `type`
    ,'Alerts' type_fra
    ,'User' issue_type
    ,'UPI' sub_issue_type
    from fraud.transaction_details_v3
    where updated_date BETWEEN date_sub('2022-11-11',7) AND date_sub('2022-11-11',1)
    and errorcode = 'SUCCESS' and pay_transaction_status = 'COMPLETED'
    and receivertype = 'INTERNAL_USER'
    and receiveruser != ''
    group by receiveruser)a
left join
    (select DISTINCT identifier from fraud.aml_freshdesk WHERE run_date < '2022-11-11') d
on a.identifier = d.identifier
left join
    (select user_ext_id AS identifier, MAX(updated) as BLdate 
    from users.users 
    where blacklisted = 1 and blacklist_reason = 'SAM'
    GROUP BY user_ext_id HAVING BLdate < '2022-11-11')f
On a.identifier = f.identifier
left join 
    (select identifier from fraud.aml_receiverside_temporary UNION select identifier from fraud.aml_receiverside_External_temporary) g 
On d.identifier = g.identifier
where f.identifier is NULL AND g.identifier IS NULL AND a.vpa < 15
ORDER BY value DESC
LIMIT 5
const Segments: React.FC = () => {
const [selected, setSelected] = useState<string | undefined>('message');

    return (
    <>
        <IonPage>
            <IonContent>
                <IonSegment value={selected} onIonChange={(event)=> setSelected(event.detail.value)}>

                    <IonSegmentButton value="message">
                        <IonLabel>Message</IonLabel>
                    </IonSegmentButton>

                    <IonSegmentButton value="favourite">
                        <IonLabel>Favourite</IonLabel>
                    </IonSegmentButton>

                    <IonSegmentButton value="calls">
                        <IonLabel>Calls</IonLabel>
                    </IonSegmentButton>
                </IonSegment>

                {/* segment content starts here */}
                <div className='segmentsContent'>
                    {(selected === 'message') && (
                    <div className='segmentTab'>
                        <h1>Tab 1</h1>
                    </div>
                    )}
                    {(selected === 'favourite') && (
                    <div className='segmentTab'>
                        <h1>Tab2</h1>
                    </div>
                    )}
                    {(selected === 'calls') && (
                    <div className='segmentTab'>
                        <h1>Tab3</h1>
                    </div>
                    )}
                </div>

            </IonContent>
        </IonPage>
    </>

    );
    };
    export default Segments;
    public function getSystemUsersByPhone($phone)
    {
        return $this->user->whereRaw("REPLACE(`phone`, ' ' ,'') LIKE ?", ['%'.str_replace(' ', '', $phone).'%'])->first();
    }
Martinluther
savemycodeweb
Codepen@online4
​  useEffect(()=>{
    getData();
  },[]) 
  function getData(){
    setSelected('one')
  }
%jdbc(hive)
set tez.queue.name=default;
set hive.execution.engine=tez;

select DATE_SUB('{{next_ds}}',7) starting_date, DATE_SUB('{{next_ds}}',1) ending_date
,d.active_days as active_days
,'weekly' as date_range
,d.identifier as identifier
,'Rcv_External_users_top5' red_flag 
,d.value as value
,'INR' comment
,case when e.identifier is null then 'New' else 'Repeat' end as new_or_repeat 
,'AML' as `group`
,'FRA' as `type`
,'Alerts' as type_fra
,'User' as issue_type
,'UPI' as sub_issue_type
,'2022-11-11' as run_date from
(
  select a.active_days active_days
  ,a.identifier identifier
  ,a.value value
  from
  (
    select count(distinct updated_date) active_days
    ,receiveruser identifier
    ,sum(totaltransactionamount) Value
    from fraud.transaction_details_v3
    where updated_date BETWEEN DATE_SUB('2022-11-11',7) AND DATE_SUB('2022-11-11',1)
    and errorcode = 'SUCCESS'
    and receivertype = 'INTERNAL_USER'
    and workflowtype  = 'EXTERNAL_TO_CONSUMER'
    group by receiveruser 
    having Value>= 1000000
  ) a
  join
  (
    select count(distinct updated_date) active_days
    ,receiveruser identifier
    ,count(distinct transaction_id) Value
    from fraud.transaction_details_v3
    where updated_date BETWEEN DATE_SUB('2022-11-11',7) AND DATE_SUB('2022-11-11',1)
    and errorcode = 'SUCCESS'
    and receivertype = 'INTERNAL_USER'
    and workflowtype  = 'EXTERNAL_TO_CONSUMER'
    group by receiveruser
  ) b
  On a.identifier = b.identifier
  join
  (
    select count(distinct updated_date) active_days
    ,receiveruser identifier
    ,count(distinct sender_vpa) Value
    from fraud.transaction_details_v3
    where updated_date BETWEEN DATE_SUB('2022-11-11',7) AND DATE_SUB('2022-11-11',1)
    and errorcode = 'SUCCESS'
    and receivertype = 'INTERNAL_USER'
    and workflowtype = 'EXTERNAL_TO_CONSUMER'
    and totaltransactionamount >= 500
    and receivertype is not NULL
    group by receiveruser
    having Value >= 500) C
  On A.identifier = C.identifier
)d
left join 
    (select DISTINCT identifier from fraud.aml_freshdesk WHERE run_date < '2022-11-11') e 
On d.identifier = e.identifier
left join
    (select user_ext_id AS identifier
    , MAX(updated) as BLdate --
    from users.users 
    where blacklisted = 1 and blacklist_reason = 'SAM'
    GROUP BY user_ext_id HAVING BLdate < '2022-11-11'
    )f
On d.identifier = f.identifier
left join 
    (select DISTINCT identifier from fraud.aml_receiverside_temporary) g 
On d.identifier = g.identifier
where d.identifier is NOT NULL AND f.identifier is NULL AND g.identifier IS NULL
ORDER BY value DESC LIMIT 5
%jdbc(hive)
set tez.queue.name=default;
set hive.execution.engine=tez;

SELECT '2022' AS year, monthNo, 'MIN + FULL' as kyc, P.catg as risk_catg
, 'Hourly' as Frequency
-- , 'Daily' as Frequency
-- , 'Monthly' as Frequency
, P.breaches
, 'WalletTopupTxnCntHourly' as rule 
-- , 'WalletTopupTxnCntDaily' as rule 
-- , 'WalletTopupTxnCntMonthly' as rule 
FROM
    (SELECT Z.monthNo, Z.catg, SUM(IF(Z.txns >= Z.limit, 1, 0)) AS breaches FROM
        (SELECT A.monthNo, A.senderuserid, A.transaction_id, COUNT(DISTINCT B.transaction_id) as txns, 
        IF(C.hml_category IS NOT NULL, C.hml_category, 'LOW RISK') AS catg,
        CASE WHEN C.hml_category = 'HIGH RISK' THEN 2 WHEN C.hml_category = 'MEDIUM RISK' THEN 3 ELSE 5 END AS limit
        -- CASE WHEN C.hml_category = 'HIGH RISK' THEN 5 WHEN C.hml_category = 'MEDIUM RISK' THEN 8 ELSE 10 END AS limit
        -- CASE WHEN C.hml_category = 'HIGH RISK' THEN 60 WHEN C.hml_category = 'MEDIUM RISK' THEN 80 ELSE 100 END AS limit
        FROM
            (SELECT DISTINCT senderuserid, transaction_id, transaction_time AS txnTime, month(updated_date) as monthNo
            from fraud.transaction_details_v3     
            where year(updated_date) = 2022 and month(updated_date) = 11
            and sendertype = 'INTERNAL_USER' AND workflowtype = 'CONSUMER_TO_MERCHANT'
            and pay_transaction_status = 'COMPLETED' AND errorcode = 'SUCCESS'
            and receiveruser in ('PHONEPEWALLETTOPUP','NEXUSWALLETTOPUP'))A
        LEFT JOIN
            (SELECT DISTINCT senderuserid, transaction_id, transaction_time AS txnTime, month(updated_date) as monthNo
            from fraud.transaction_details_v3     
            where year(updated_date) = 2022 and month(updated_date) IN (11-1,11)
            and sendertype = 'INTERNAL_USER' AND workflowtype = 'CONSUMER_TO_MERCHANT'
            and pay_transaction_status = 'COMPLETED' AND errorcode = 'SUCCESS'
            and receiveruser in ('PHONEPEWALLETTOPUP','NEXUSWALLETTOPUP'))B
        ON A.senderuserid = B.senderuserid AND A.monthNo >= B.monthNo
        AND ((UNIX_TIMESTAMP(A.txnTime) - UNIX_TIMESTAMP(B.txnTime))/3600) BETWEEN 0 AND 1 
        -- AND ((UNIX_TIMESTAMP(A.txnTime) - UNIX_TIMESTAMP(B.txnTime))/86400) BETWEEN 0 AND 1 
        -- AND ((UNIX_TIMESTAMP(A.txnTime) - UNIX_TIMESTAMP(B.txnTime))/2592000) BETWEEN 0 AND 1 
        AND A.txnTime > B.txnTime
        LEFT JOIN
            (SELECT DISTINCT senderuserid, hml_category
            FROM fraud.hml_classification)C
        ON A.senderuserid = C.senderuserid
        GROUP BY A.senderuserid, A.transaction_id, C.hml_category, A.monthNo
        HAVING txns >= 5)Z
    GROUP BY Z.catg, Z.monthNo)P
Private Sub TestTemp()
On Error GoTo ErrorHandler
Dim strSQL as String
Dim strTable as String
strTable = "tblTempTest"
'Delete the table if it exists
DoCmd.DeleteObject  acTable, strTable
strSQL = "Select * INTO " & strTable & " FROM tblCustomers " & _
"Where CustomerState = 'ILL'"
Currentdb.Execute strSQL
'Insert more code here to do something with temp table
Exit Sub
ErrorHandler:
IF Err.Number = 7874 Then
Resume Next 'Tried to delete a non-existing table, resume
End If
End Sub
function sm_validate_title_client_side() {
	echo "
	<script>
	jQuery('body').on('focus', '[contenteditable]', function() {}).on('paste input', '[contenteditable]', function() {
		let title = event.target.innerText;
		let inputIsValid = !title.includes(String.fromCharCode(160));
		let button = jQuery('.editor-post-publish-button__button');
		if (!inputIsValid) {
			button.disabled = true; //setting button state to disabled;
			alert('invalid input');
	        } else {
			button.disabled = false;
			}
		});
		
	</script>";
}

add_action('admin_footer', 'sm_validate_title_client_side');
/**
 * Remove Sale Badge
 */
add_filter('woocommerce_sale_flash', 'ml_hide_sale_flash');
function ml_hide_sale_flash()
{
return false;
}


/**
 * Change sale text to percentage. Always Display the selected variation price for variable products (already working)
 */
add_filter( 'woocommerce_show_variation_price', 'filter_show_variation_price', 10, 3 );
function filter_show_variation_price( $condition, $product, $variation ){
    if( $variation->get_price() === "" ) return false;
    else return true;
}
// Remove the displayed price from variable products in single product pages only
add_action( 'woocommerce_single_product_summary', 'remove_the_displayed_price_from_variable_products', 9 );
function remove_the_displayed_price_from_variable_products() {
    global $product;

    // Just for variable products
    if( ! $product->is_type('variable') ) return;

    // Remove the displayed price from variable products
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
}
// Display the selected variation discounted price with the discounted percentage for variable products
add_filter( 'woocommerce_format_sale_price', 'woocommerce_custom_sales_price', 10, 3 );
function woocommerce_custom_sales_price( $price, $regular_price, $sale_price ) {
    global $product;

    // Just for variable products on single product pages
    if( $product->is_type('variable') && is_product() ) {
    
        // Getting the clean numeric prices (without html and currency)
        $regular_price = floatval( strip_tags($regular_price) );
        $sale_price = floatval( strip_tags($sale_price) );
    
        // Percentage calculation and text
        $percentage = round( ( $regular_price - $sale_price ) / $regular_price * 100 ).'%';
        $percentage_txt = __(' save up to ', 'woocommerce' ).$percentage;
		$percentage_txt = __('<p class="ml-sale"> save ', 'woocommerce' ).$percentage; '</p>';
    
        return '<del>' . wc_price( $regular_price ) . '</del> <ins>' . wc_price( $sale_price ) . $percentage_txt . '</ins>';
    }
    return $price;
}


/**
 * display variations sale badge only when a variation on sale is selected
 */
add_action( 'woocommerce_before_single_variation', 'action_wc_before_single_variation' );
function action_wc_before_single_variation() {
    ?>
    <script type="text/javascript">
    (function($){
        // Check for the show_variation event that triggers when a variation is selected.
        $('form.variations_form').on('show_variation', function(event, data){
            //If variation is on sale, display the sale badge
            if(data.display_price < data.display_regular_price){
                $(".product-type-variable .onsale").css("display", "block");
            }
            //Otherwise hide the sale badge
            else {
                $(".product-type-variable .onsale").css("display", "none");
            }
        });
    })(jQuery);
    </script>
    <?php
}


/**
 * Add some attribute values to WooCommerce variable product title from chosen variation
 */
 // Defining product Attributes term names to be displayed on variable product title
add_filter( 'woocommerce_available_variation', 'filter_available_variation_attributes', 10, 3 );
function filter_available_variation_attributes( $data, $product, $variation ){
    // Here define the product attribute(s) slug(s) which values will be added to the product title
    // Or replace the array with 'all' string to display all attribute values
    $attribute_names = array('Custom', 'Color');

    foreach( $data['attributes'] as $attribute => $value ) {
        $attribute      = str_replace('attribute_', '', $attribute);
        $attribute_name = wc_attribute_label($attribute, $variation);

        if ( ( is_array($attribute_names) && in_array($attribute_name, $attribute_names) ) || $attribute_names === 'all' ) {
            $value = taxonomy_exists($attribute) ? get_term_by( 'slug', $value, $attribute )->name : $value;

            $data['for_title'][$attribute_name] = $value;
        }
    }
    return $data;
}

// Display to variable product title, defined product Attributes term names
add_action( 'woocommerce_after_variations_form', 'add_variation_attribute_on_product_title' );
function add_variation_attribute_on_product_title(){
    // Here define the separator string
    $separator = ' - ';
    ?>
    <script type="text/javascript">
    (function($){
        var name = '<?php global $product; echo $product->get_name(); ?>';

        $('form.cart').on('show_variation', function(event, data) {
            var text = '';

            $.each( data.for_title, function( key, value ) {
                text += '<?php echo $separator; ?>' + value;
            });

            $('.product_title').text( name + text );

        }).on('hide_variation', function(event, data) {
            $('.product_title').text( name );
        });
    })(jQuery);
    </script>
    <?php
}

/**
 * Replace the Variable Price range by the chosen variation price
 */
add_action('woocommerce_before_add_to_cart_form', 'selected_variation_price_replace_variable_price_range');
function selected_variation_price_replace_variable_price_range(){
    global $product;

    if( $product->is_type('variable') ):
    ?><style> .woocommerce-variation-price {display:none;} </style>
    <script>
    jQuery(function($) {
        var p = 'p.price'
            q = $(p).html();

        $('form.cart').on('show_variation', function( event, data ) {
            if ( data.price_html ) {
                $(p).html(data.price_html);
            }
        }).on('hide_variation', function( event ) {
            $(p).html(q);
        });
    });
    </script>
    <?php
    endif;
}


/**
 * replace variable product short description by the selected variation description if it's not empty
 */
add_action( 'woocommerce_before_variations_form', 'variable_product_jquery_script' );
function variable_product_jquery_script() {
    ?>
    <style>.woocommerce-variation-description {display:none !important}</style>
    <script>
    (function($) {
        var selector  = '.woocommerce-product-details__short-description',
            form      = $('form.cart'),
            shortDesc = $(selector).html();

        form.on('show_variation', function(event, data){
            var varDesc = data.variation_description;       
            $(selector).html( varDesc ? varDesc : shortDesc );
        });

        form.on('hide_variation', function(){
            $(selector).html(shortDesc);
        });
    })(jQuery);
    </script>
    <?php
}
/**
 * replace variable product short description by the selected variation description if it's not empty
 */
add_action( 'woocommerce_before_variations_form', 'variable_product_jquery_script' );
function variable_product_jquery_script() {
    ?>
    <style>.woocommerce-variation-description {display:none !important}</style>
    <script>
    (function($) {
        var selector  = '.woocommerce-product-details__short-description',
            form      = $('form.cart'),
            shortDesc = $(selector).html();

        form.on('show_variation', function(event, data){
            var varDesc = data.variation_description;       
            $(selector).html( varDesc ? varDesc : shortDesc );
        });

        form.on('hide_variation', function(){
            $(selector).html(shortDesc);
        });
    })(jQuery);
    </script>
    <?php
}
/**
 * Allow to use a duplicate sku
 */
add_filter( 'wc_product_has_unique_sku', '__return_false' );
star

Thu Nov 17 2022 07:41:28 GMT+0000 (Coordinated Universal Time)

@jayasreekonduru ##html ##css

star

Thu Nov 17 2022 07:37:04 GMT+0000 (Coordinated Universal Time) https://codepen.io/pen

@Martinluther #undefined

star

Thu Nov 17 2022 07:34:29 GMT+0000 (Coordinated Universal Time)

@jayasreekonduru ##html ##css

star

Thu Nov 17 2022 07:30:13 GMT+0000 (Coordinated Universal Time)

@yarenrkmez

star

Thu Nov 17 2022 07:25:23 GMT+0000 (Coordinated Universal Time)

@jayasreekonduru ##html ##css

star

Thu Nov 17 2022 07:18:09 GMT+0000 (Coordinated Universal Time)

@jayasreekonduru ##html ##css

star

Thu Nov 17 2022 06:25:44 GMT+0000 (Coordinated Universal Time)

@ahmed.toson

star

Thu Nov 17 2022 06:18:29 GMT+0000 (Coordinated Universal Time)

@DGSH9

star

Thu Nov 17 2022 06:17:04 GMT+0000 (Coordinated Universal Time)

@DGSH9

star

Thu Nov 17 2022 06:16:30 GMT+0000 (Coordinated Universal Time)

@DGSH9

star

Thu Nov 17 2022 06:14:34 GMT+0000 (Coordinated Universal Time) https://codepen.io/pen

@Martinluther

star

Thu Nov 17 2022 05:42:30 GMT+0000 (Coordinated Universal Time) https://webflow.com/design/digital-wings

@Kiwifruit

star

Thu Nov 17 2022 05:35:39 GMT+0000 (Coordinated Universal Time) https://webflow.com/design/digital-wings

@Kiwifruit

star

Thu Nov 17 2022 05:19:26 GMT+0000 (Coordinated Universal Time)

@jayasreekonduru ##html ##css

star

Thu Nov 17 2022 04:57:58 GMT+0000 (Coordinated Universal Time)

@jayasreekonduru ##html ##css

star

Thu Nov 17 2022 04:42:34 GMT+0000 (Coordinated Universal Time)

@jayasreekonduru ##html ##css

star

Thu Nov 17 2022 04:16:08 GMT+0000 (Coordinated Universal Time)

@ahmed.toson

star

Thu Nov 17 2022 04:03:37 GMT+0000 (Coordinated Universal Time)

@ahmed.toson

star

Thu Nov 17 2022 04:03:11 GMT+0000 (Coordinated Universal Time)

@ahmed.toson

star

Thu Nov 17 2022 00:17:12 GMT+0000 (Coordinated Universal Time) https://www.sqlshack.com/working-with-parameters-in-the-sp_executesql-stored-procedure/

@p83arch

star

Wed Nov 16 2022 23:40:17 GMT+0000 (Coordinated Universal Time) https://www.wikihow.com/Calculate-Volume-in-Litres

@DominiqueGrys

star

Wed Nov 16 2022 23:15:56 GMT+0000 (Coordinated Universal Time) http://localhost:40000/https://filedn.com/l2NvsfUSxVNj15A0lEfa214/............COD3 SNIPPETS AND CODEPEN EXPTS/codecanyon-pkqKBhN6-collection-set-of-css3-content-box/ContentBox_package/Content Box files/

@Shookthadev999

star

Wed Nov 16 2022 22:48:46 GMT+0000 (Coordinated Universal Time) https://developers.google.com/apps-script/reference/base/ui

@idontwantto

star

Wed Nov 16 2022 18:14:33 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/64382996/how-to-center-text-with-image-in-p-tag

@benjaminb

star

Wed Nov 16 2022 17:55:03 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif

star

Wed Nov 16 2022 17:06:13 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif

star

Wed Nov 16 2022 16:50:40 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif

star

Wed Nov 16 2022 16:22:14 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif

star

Wed Nov 16 2022 15:43:52 GMT+0000 (Coordinated Universal Time)

@Plastikov #go

star

Wed Nov 16 2022 15:09:28 GMT+0000 (Coordinated Universal Time) https://designcode.io/tutorials

@poliku102

star

Wed Nov 16 2022 14:29:22 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/53433293/laravel-collective-how-to-set-formdate-default-value-based-on-the-object-value

@eneki #php

star

Wed Nov 16 2022 14:11:22 GMT+0000 (Coordinated Universal Time) https://www.freecodecamp.org/news/html-starter-template-a-basic-html5-boilerplate-for-index-html/

@madams

star

Wed Nov 16 2022 14:11:01 GMT+0000 (Coordinated Universal Time) https://www.freecodecamp.org/news/html-starter-template-a-basic-html5-boilerplate-for-index-html/

@madams

star

Wed Nov 16 2022 14:10:33 GMT+0000 (Coordinated Universal Time) https://www.freecodecamp.org/news/html-starter-template-a-basic-html5-boilerplate-for-index-html/

@madams

star

Wed Nov 16 2022 13:03:49 GMT+0000 (Coordinated Universal Time)

@shubhangi_burle

star

Wed Nov 16 2022 11:25:43 GMT+0000 (Coordinated Universal Time)

@Martinluther #undefined

star

Wed Nov 16 2022 11:25:06 GMT+0000 (Coordinated Universal Time)

@eneki

star

Wed Nov 16 2022 11:14:40 GMT+0000 (Coordinated Universal Time)

@Martinluther #undefined

star

Wed Nov 16 2022 11:12:38 GMT+0000 (Coordinated Universal Time) https://codepen.io/pen

@Martinluther #undefined

star

Wed Nov 16 2022 10:52:11 GMT+0000 (Coordinated Universal Time)

@shubhangi_burle

star

Wed Nov 16 2022 10:47:48 GMT+0000 (Coordinated Universal Time)

@shubhangi_burle

star

Wed Nov 16 2022 09:06:10 GMT+0000 (Coordinated Universal Time) https://accessexperts.com/blog/2011/07/20/use-temp-tables-in-your-code-for-quick-and-easy-analysis/

@paulbarry

star

Wed Nov 16 2022 08:48:11 GMT+0000 (Coordinated Universal Time) https://hostperl.com/unmanaged-dedicated-server.html

@hostperl #dedicatedserver #server #servers #hosting #dedicatedhosting

star

Wed Nov 16 2022 08:47:57 GMT+0000 (Coordinated Universal Time) https://wordpress.org/support/topic/wordpress-text-editor-input-validation-prevent-save-when-certain-characters-are/#

@chonlemon

star

Wed Nov 16 2022 08:46:34 GMT+0000 (Coordinated Universal Time) https://hostperl.com/shared-hosting.html

@hostperl #hosting #webhosting #vps #servers

star

Wed Nov 16 2022 08:44:35 GMT+0000 (Coordinated Universal Time) https://blog.hostperl.com/post/661913670655377409/what-are-the-top-free-website-hosting-services-to

@hostperl #hosting #server #servers #vps

star

Wed Nov 16 2022 08:42:38 GMT+0000 (Coordinated Universal Time)

@mastaklance

star

Wed Nov 16 2022 08:28:42 GMT+0000 (Coordinated Universal Time)

@mastaklance

Save snippets that work with our extensions

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