Snippets Collections
extends CharacterBody2D


var SPEED = 300.0
var vel : float

func _physics_process(delta):
	
	move_local_x(vel * SPEED * delta)
	



func _on_area_2d_area_entered(area):
	
	var areas = $Area2D.get_overlapping_areas()
	
	print(area.get_groups())
	
	for i in areas:
		
		if area.is_in_group("Enemy"):
			
			area.hit()
extends CharacterBody2D

@onready var knife = preload("res://Scenes/knife.tscn")

@export var SPEED : int = 150
@export var JUMP_FORCE : int = 255
@export var GRAVITY : int = 900

var is_attacking = false
var can_trow = true

func _physics_process(delta):
	
	
	var direction = Input.get_axis("Left","Right")
	
	if direction:
		
		velocity.x = SPEED * direction
		
		if is_on_floor() and is_attacking == false:
			
			$Flip/AnimatedSprite2D.play("Run")
		
	else:
		
		velocity.x = 0
		
		if is_on_floor() and is_attacking == false:
			
			$Flip/AnimatedSprite2D.play("Idle")
	
	# Rotate
	
	if direction == 1:
		$Flip.scale.x = 1
	elif direction == -1:
		$Flip.scale.x = -1
	
	# Gravity
	
	if not is_on_floor():
		
		velocity.y += GRAVITY * delta
		
		if velocity.y > 0:
			
			$Flip/AnimatedSprite2D.play("Fall")
	
	# Jump
	
	if is_on_floor():
		
		if Input.is_action_just_pressed("Jump"):
			
			velocity.y -= JUMP_FORCE
			
			$Flip/AnimatedSprite2D.play("Jump")
	
	
	
	# Trow
	
	if Input.is_action_just_pressed("Trow"):
		
		if can_trow:
			
			can_trow = false
			
			$Flip/AnimatedSprite2D.play("Trow") 
			is_attacking = true
			
			
			var k = knife.instantiate()
			k.vel = $Flip.scale.x
			k.global_position = $Flip/TrowPos.global_position
			get_parent().add_child(k)
		
	
	if is_attacking:
		
		velocity = Vector2.ZERO
		await $Flip/AnimatedSprite2D.animation_finished
		is_attacking = false
		can_trow = true
	
	
	move_and_slide()




void merge(vector<int>&arr,int l,int mid,int h)
{
   vector<int>temp;
   int i=l;
   int j=mid+1;
while(i<=mid and j<=h)
{
    if(arr[i]<=arr[j])
    {
        temp.push_back(arr[i]);
        i++;
    }
    else 
    {
        temp.push_back(arr[j]);
        j++;
    }
}
while(i<=mid)
{
    temp.push_back(arr[i]);
    i++;
}
while(j<=h)
{
    temp.push_back(arr[j]);
    j++;
}
for(int i=l ; i<=h ; i++)
{
    arr[i]=temp[i-l];
}
}
void me(vector<int>&arr,int l,int h)
{
   
    if(l>h)
    return;
    int mid=(l+h)/2;
    me(arr,l,mid);
    me(arr,mid+1,h);
    merge(arr,l,mid,h);
}
void mergeSort(vector < int > & arr, int n)
{
    me(arr,0,n-1);
}
#include <bits/stdc++.h> 
string encode(string &message)
{
    string ans="";
    int count=1;
    int n=message.size();
    for(int i=0 ; i<n ; i++)
    {
        if(message[i]==message[i+1])
        {
           count++;  
        }
         ans+=message[i];
    ans+=to_string(count);
    count=1;
    }
   
    return ans;
}
Object.defineProperty(String.prototype, "SayHi", {
    value: function SayHi() {
        return "Hi " + this + "!";
    },
    writable: true,
    configurable: true
});

console.log("Charlie".SayHi());
#include <bits/stdc++.h> 
int minimumParentheses(string pattern)
{
    int cnt=0;
    int req=0;
    for(int i=0 ; i<=pattern.length()-1 ; i++) 
    {
         if(pattern[i]=='(')
         {
             cnt++;
         }
         else if(pattern[i]==')' and cnt>0)
         {
             cnt--;
         }
         else
         {
             req++;
         }
    }  
    return cnt+req;
}
#include <bits/stdc++.h>
bool search(int arr[],int n,int num)
{
    for(int i=0 ; i<=n ; i++)
    {
        if(arr[i]==num)
        return true;
    }
    return false;
} 
int firstMissing(int arr[], int n)
{
   for(int i=1 ; i<=n ; i++)
   {
       if(search(arr,n,i)==false)
       return i;
   }
   return n+1;
}

time complexity-O(N2)
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
 <!-- BUTTON : BEGIN --><table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%">  <tr>   <td align="center" class="mobile-center" style="padding-top: 0px;padding-bottom:0px;padding-left:0px;padding-right:0px; " valign="top">   <!--[if (gte mso 9)|(IE)]><table role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" width="140" style="width:140px;"><tr><td align="center" valign="top" width="100%"><![endif]--> <table border="0" cellpadding="0" cellspacing="0" class="mobile-center" role="presentation" style="text-align: left; display:inline-block;">      <tr>       <td class="button-yellow-td mobBt" style="background: #ffc506; border: 1px solid #ffc506; font-family:Arial Black, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 15px; text-align: center; display: block; font-weight: bold;padding-top: 12px;padding-bottom: 12px;padding-left: 12px;padding-right: 12px;mso-line-height-rule: exactly; width: 140px" width="140">        <a alias="read_blog_cta5" class="button-yellow-a" href="https://www.cat.com/en_US/blog/is-your-organization-a-good-fit-for-eaas.html" style="text-decoration: none;" target="_blank" title="READ BLOG"><span class="button-yellow-link" style="color:#000000;text-transform:uppercase;">READ <br class="mobile-hidden">BLOG</span> </a></td></tr></table><!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]--></td></tr></table>        <!-- BUTTON : END -->
https://astro.build/config
export default defineConfig({
  //site: 'https://astrofy-template.netlify.app',
  integrations: [mdx(), sitemap(), tailwind(), image(
    {
      serviceEntryPoint: '@astrojs/image/sharp',
      cacheDir: "./.cache/image",
      logLevel: 'debug',
    }
  )]
});
<object data="{{ $url }}" width="100%" height="100%">
      <embed src="{{ $url }}" width="100%" height="100%"></embed>
      Error: Embedded data could not be displayed.
</object>
/*chyba: text v <div> při rotaci je rozmazaný, tohle dát do Hlavního prvku textu*/
-webkit-transform: rotate(-2deg);  /* Chrome, Safari 3.1+ */
 -moz-transform: rotate(-2deg);  /* Firefox 3.5-15 */
  -ms-transform: rotate(-2deg);  /* IE 9 */
   -o-transform: rotate(-2deg);  /* Opera 10.50-12.00 */
      transform: rotate(-2deg);
 
const totalPrice = items.reduce((accumulator ,item) => {
  return accumulator += item.price;
}, 0)
/* eslint-disable no-param-reassign */
/* eslint-disable no-underscore-dangle */
/* eslint-disable max-len */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable import/no-extraneous-dependencies */
import React, { FormEventHandler, useEffect, useState } from 'react';
import { useForm, Controller, SubmitHandler } from 'react-hook-form';
import { Autocomplete, Box, TextField } from '@mui/material';
import IconSave from '@assets/icon-save.svg';
import * as yup from 'yup';
import { yupResolver } from '@hookform/resolvers/yup';
import { Col, Row } from 'react-bootstrap';
import {
  fetchLitigantApplicationDetails,
  lawFirmRegistrationDetailSelector,
  setisValidRegistrationForm,
  submitLitigantApplicationDetails,
} from '@redux/slices/law-firm-registration';
import { useDispatch, useSelector } from 'react-redux';
import { trackPromise } from 'react-promise-tracker';
import api from '@api/index';
import {
  resetErrorState,
  setErrorInfo,
} from '@redux/slices/will-personal-information';
import { dropDownSelector, fetchCountryList } from '@redux/slices/dropDowns';
import './style.scss';
import useIsdCodesList from '@utils/hooks/useIsdCodesList';

interface LitigantProbonoApplicant {
  litigantGuid: string;
  applicantName: string;
  applicantAddress: string;
  applicantTelephone: string;
  applicantFax: string;
  applicantMobile: string;
  applicantEmail: string;
  isdCodeApplicantMobile: string;
}

interface Props {
  completed: { [k: number]: boolean };
  handleComplete: () => void;
  completedSteps: () => number;
  totalSteps: () => number;
  activeStep: number;
  handleBack: () => void;
  isLastStep: () => boolean;
}

const commonSchema = yup.object().shape({
  applicantName: yup.string().required('Applicant Name is required'),
  applicantEmail: yup
    .string()
    .email('Invalid email')
    .required('Applicant Email Address is required'),
  applicantAddress: yup.string().required('Address is required'),
  applicantTelephone: yup
    .string()
    .required('Telephone number is required')
    .matches(/^[0-9]{6,14}$/, 'Invalid telephone number'),
  applicantMobile: yup.string().required('Mobile number is required'),
  applicantFax: yup.string().required('Fax number is required'),
  isdCodeApplicantMobile: yup.string().required('Isd Code is required'),
});

const draftSchema = yup.object().shape({
  applicantName: yup.string().required('Applicant Name is required'),
  applicantEmail: yup
    .string()
    .email('Invalid email')
    .required('Applicant Email Address is required'),
});

function index({
  completed,
  handleComplete,
  completedSteps,
  totalSteps,
  activeStep,
  handleBack,
  isLastStep,
}: Props) {
  const [applicantMobile, setApplicantMobile] = useState<string>('');
  const [isdCodeLabel, setIsdCodeLabel] = useState<any>('');
  const [isdCode1, setIsdCode1] = useState<string>('');
  const [flagForLitigantApplicant, setFlagForLitigantApplicant] = useState<boolean>(false);
  const [isSubmitted, setIsSubmitted] = useState<boolean>(false);
  const [isDraft, setIsDraft] = useState<boolean>(false);
  const [submitBtn, setSubmitBtn] = useState(false);
  const [emailValidation, setEmailValidation] = useState(false);
  const [isNext, setIsNext] = useState<boolean | null>(null);
  const dispatch = useDispatch();

  const schema = isNext ? commonSchema : draftSchema;
  const {
    control,
    handleSubmit,
    reset,
    setValue,
    register,
    clearErrors,
    setError,
    trigger,
    formState: { errors },
  } = useForm<LitigantProbonoApplicant>({
    resolver: yupResolver(schema as yup.AnyObjectSchema),
    defaultValues: {
      // cityID: null, countryID: null, homeJurisdiction: null, phoneNo: '',
    },
  });

  console.log('litiganterrors', errors);

  console.log('isDraft', isDraft);

  const { litigantGuid, litigantDetails, isValidRegistrationForm } = useSelector(lawFirmRegistrationDetailSelector);

  const checkLitigantEmail = async (email: string) => {
    console.log('litigantGuid', litigantGuid);
    await dispatch(resetErrorState());
    try {
      // Make the API call here (e.g., using fetch or Axios)
      const response: any = await trackPromise(
        api.checkIfLitigantEmailRegistered(email, litigantGuid),
      );
      if (response?.data?.applicantEmalExists) {
        setFlagForLitigantApplicant(true);
        dispatch(setErrorInfo('Litigant Email already exists!'));
        dispatch<any>(setisValidRegistrationForm(false));
        // If the firm name already exists, set the error message for the Firm Name field
        setError('applicantEmail', {
          type: 'manual',
          message: 'Litigant Email already exists',
        });
      } else {
        dispatch<any>(setisValidRegistrationForm(true));
        setFlagForLitigantApplicant(false);
        // If the firm name is unique, clear the error message for the Firm Name field
        clearErrors('applicantEmail');
      }
    } catch (error) {
      console.error('Error making API call:', error);
    }
  };

  // Utility function to filter out all IDs from the list
  const filterList = (list: any[], condition: (item: any) => boolean) => list.filter((item: any) => {
    if (condition(item)) {
      return item;
    }
    return '';
  });

  // Get all dropdown lists from redux
  const { countryList } = useSelector(dropDownSelector);

  // Custom hooks for getting various list information
  const isdCodesList = useIsdCodesList(countryList);

  const onSubmit: SubmitHandler<LitigantProbonoApplicant> = async (
    data: LitigantProbonoApplicant,
  ) => {
    // setSubmitBtn(true);
    // await checkLitigantEmail(data.applicantEmail);
    await trigger(['applicantEmail']);
    if (Object.keys(errors).length === 0) {
      const formData: LitigantProbonoApplicant = {
        litigantGuid,
        applicantName: data.applicantName,
        applicantAddress: data.applicantAddress,
        applicantTelephone: data.applicantTelephone,
        applicantFax: data.applicantFax,
        applicantEmail: data.applicantEmail,
        applicantMobile,
        isdCodeApplicantMobile: isdCode1,
      };
      if (isValidRegistrationForm) {
        await dispatch<any>(
          submitLitigantApplicationDetails(formData, isDraft),
        );
        if (!isDraft) handleComplete();
        if (!isDraft) reset();
        window.scrollTo(0, 0);
      }
    }
  };

  const submitFromSave = async (data: any) => {
    console.log('Litigant Data', data);

    const litigantDraft:LitigantProbonoApplicant = {
      litigantGuid,
      applicantName: data.applicantName,
      applicantAddress: data.applicantAddress,
      applicantTelephone: data.applicantTelephone,
      applicantFax: data.applicantFax,
      applicantEmail: data.applicantEmail,
      applicantMobile,
      isdCodeApplicantMobile: isdCode1,
    };

    await dispatch<any>(
      submitLitigantApplicationDetails(litigantDraft, isDraft),
    );
  };

  const emailValidationRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;

  React.useEffect(() => {
    window.scrollTo(0, 0);
    dispatch<any>(fetchCountryList());
  }, []);

  useEffect(() => {
    if (litigantGuid !== '') {
      dispatch<any>(fetchLitigantApplicationDetails(litigantGuid));
    }
  }, [litigantGuid]);

  const handleIsdCode1Change = (e: any, val: any) => {
    const isdCode1Value = val?.countryID;
    const isdCode1Label = val?.label;
    setIsdCode1(isdCode1Value);
    setIsdCodeLabel(isdCode1Label);
  };

  useEffect(() => {
    if (litigantDetails) {
      const isCode = filterList(
        isdCodesList,
        (item: any) => item.countryID === litigantDetails?.isdCodeApplicantMobile,
      );
      console.log('isdCode', isCode);
      setValue('applicantName', litigantDetails.applicantName);
      setValue('applicantAddress', litigantDetails.applicantAddress);
      setValue('applicantTelephone', litigantDetails.applicantTelephone);
      // setValue('iSDCodeApplicantTelephone', litigantDetails.isdCodeApplicantMobile);
      setValue('applicantFax', litigantDetails.applicantFax);
      setValue('applicantMobile', litigantDetails.applicantMobile);
      setValue('applicantEmail', litigantDetails.applicantEmail);
      setValue(
        'isdCodeApplicantMobile',
        litigantDetails.isdCodeApplicantMobile,
      );
      setApplicantMobile(litigantDetails.applicantMobile);
      setIsdCode1(isCode[0]?.countryID);
      setIsdCodeLabel(isCode[0]?.label);
    }
  }, [litigantDetails]);

  const handlePhoneNumber1Change = (e: any) => {
    const { value } = e.target;
    // eslint-disable-next-line no-param-reassign
    e.target.value = value.replace(/[^0-9]/g, '');
    setApplicantMobile(e.target.value);
  };
  const capitalizeWords = (text: string) => text
    .split(' ')
    .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
    .join(' ');

  const handleTelephoneChange = (e: any) => {
    const { value } = e.target;
    // eslint-disable-next-line no-param-reassign
    e.target.value = value.replace(/[^0-9]/g, '');
    setValue('applicantTelephone', e.target.value);
  };

  const handleFaxChange = (e: any) => {
    const { value } = e.target;
    // eslint-disable-next-line no-param-reassign
    e.target.value = value.replace(/[^0-9]/g, '');
    setValue('applicantFax', e.target.value);
  };
  const handleCursor: FormEventHandler<HTMLInputElement> = (e: {
    currentTarget: any;
  }) => {
    const input = e.currentTarget;
    const cursorPosition = input.selectionStart || 0;
    input.value = capitalizeWords(
      input.value
        .trimStart()
        .replace(/\s+/g, ' ')
        .replace(/[^a-zA-Z\W ]/g, ''),
    );
    input.setSelectionRange(cursorPosition, cursorPosition);
  };
  const handleInput: FormEventHandler<HTMLInputElement> = (e: {
    currentTarget: any;
  }) => {
    setSubmitBtn(false);
    if (emailValidationRegex.test(e.currentTarget.value)) {
      setEmailValidation(false);
    } else {
      setEmailValidation(true);
    }
    const input = e.currentTarget;
    const cursorPosition = input.selectionStart || 0;
    input.value = input.value.trim();
    input.setSelectionRange(cursorPosition, cursorPosition);
  };
  const handleInputForAddrress = (e: { currentTarget: any }) => {
    const input = e.currentTarget;
    const cursorPosition = input.selectionStart || 0;
    input.value = capitalizeWords(input.value.trimStart());
    input.setSelectionRange(cursorPosition, cursorPosition);
  };
  return (
    <form
      className="form"
      onSubmit={handleSubmit(isNext ? onSubmit : submitFromSave)}
    >
      <h1>Application Details</h1>
      <span className="mb-3">
        Please indicate whether you will be the claimant or respondent
      </span>
      <div className="row" style={{ paddingTop: '40px' }}>
        <div className="col-md-4">
          <div className="mb-3">
            <label htmlFor="name" className="form-label firmName-label w-100">
              Name*
            </label>
            <input
              type="text"
              className={`${
                errors?.applicantName
                  ? 'validate-field'
                  : 'form-control'
              } `}
              onInput={handleCursor}
              style={{ textTransform: 'capitalize' }}
              id="applicantName"
              placeholder="Enter Name"
              // onChange={(e) => setState(e.target.value)}
              {...register('applicantName', {
                required: true,
              })}
            />
          </div>
        </div>
        <div className="col-md-4">
          <div className="mb-3">
            <label htmlFor="name" className="form-label firmName-label w-100">
              Telephone*
            </label>
            <input
              type="text"
              max={15}
              className={`${
                errors?.applicantTelephone && isSubmitted
                  ? 'validate-field'
                  : 'form-control'
              } `}
              id="applicantTelephone"
              placeholder="Enter Telephone Number"
              {...register('applicantTelephone', {
                required: true,
              })}
              onChange={handleTelephoneChange}
            />
          </div>
        </div>
      </div>
      <div className="row">
        <div className="col-md-4">
          <div className="mb-3">
            <label
              htmlFor="applicantEmail"
              className="form-label applicantEmail-label w-100"
            >
              Email*
            </label>
            <Controller
              name="applicantEmail"
              control={control}
              render={({ field }) => (
                <input
                  type="text"
                  className={`${
                    errors.applicantEmail
                    || flagForLitigantApplicant
                    || (emailValidation && submitBtn)
                      ? 'validate-field'
                      : 'form-control'
                  }`}
                  {...field}
                  {...register('applicantEmail', {
                    required: true,
                    pattern: {
                      value: emailValidationRegex,
                      message: 'Please enter a valid email',
                    },
                  })}
                  id="applicantEmail"
                  aria-describedby="emailHelp"
                  placeholder="Enter Email Address"
                  onInput={handleInput}
                  onBlur={() => checkLitigantEmail(field.value)}
                />
              )}
              rules={{
                required: 'Firm Email is required',
                pattern: {
                  value: emailValidationRegex,
                  message: 'Please enter a valid email',
                },
              }}
            />
            {/* {errors.firmEmail && (
            <p className="error-message">{errors.firmEmail.message}</p>
            )} */}
          </div>
        </div>
        <div className="col-md-4">
          <div className="mb-3">
            <label htmlFor="phoneNumber" className="form-label w-100">
              Mobile*
            </label>
            <div className="d-flex">
              <Autocomplete
                id="country-select-demo"
                // sx={{ width: 1000 }}
                options={isdCodesList}
                autoHighlight
                // value={isdCodeLabel}
                value={
                  isdCodesList.find(
                    (option: any) => option.label === isdCodeLabel,
                  ) || null
                }
                disableClearable
                getOptionLabel={(option: any) => `${option.label} ${option.countryName}`}
                // getOptionLabel={(option: any) => option?.countryName}
                renderOption={(props, option) => (
                  <Box
                    component="li"
                    sx={{ '& > img': { mr: 2, flexShrink: 0 } }}
                    {...props}
                  >
                    <img
                      loading="lazy"
                      width="20"
                      src={`https://flagcdn.com/w20/${option?.countryCode?.toLowerCase()}.png`}
                      srcSet={`https://flagcdn.com/w40/${option?.countryCode?.toLowerCase()}.png 2x`}
                      alt=""
                    />
                    {option?.countryName}
                    {' '}
                    (
                    {option?.label}
                    )
                  </Box>
                )}
                renderInput={(params) => (
                  <TextField
                    {...params}
                    placeholder="+97"
                    // value={isdCodeLabel || ''}
                    inputProps={{
                      ...params.inputProps,
                      autoComplete: 'new-password', // disable autocomplete and autofill
                    }}
                    {...register('isdCodeApplicantMobile', {
                      required: true,
                    })}
                    error={
                      errors?.isdCodeApplicantMobile
                      && (isdCodeLabel === '' || isdCodeLabel === undefined)
                    }
                    className="isdcode-field"
                  />
                )}
                className="isdcode-box"
                onChange={(e, newVal: any) => handleIsdCode1Change(e, newVal)}
              />
              <input
                type="text"
                placeholder="Enter Phone Number"
                maxLength={15}
                // className={`${
                //   isSubmitted
                //   && (applicantMobile === '' || applicantMobile === undefined)
                //     ? 'phonenumber-input-error'
                //     : 'form-control-phonenumber'
                // } `}
                className={`${
                  errors?.applicantMobile && isSubmitted && (applicantMobile === '' || applicantMobile === undefined)
                    ? 'phonenumber-input-error'
                    : 'form-control-phonenumber'
                } `}
                id="applicantMobile"
                aria-describedby="applicantMobileHelp"
                {...register('applicantMobile', {
                  required: true,
                })}
                onChange={(e: any) => handlePhoneNumber1Change(e)}
              />
            </div>
          </div>
        </div>
      </div>
      <div className="row">
        <div className="col-md-4">
          <div className="mb-3">
            <label
              htmlFor="applicantFax"
              className="form-label applicantFax-label w-100"
            >
              Fax*
            </label>
            <input
              type="text"
              className={`${
                errors?.applicantFax && isSubmitted
                  ? 'validate-field'
                  : 'form-control'
              } `}
              id="applicantFax"
              placeholder="Enter Fax Number"
              {...register('applicantFax', {
                required: true,
              })}
              onChange={handleFaxChange}
            />
          </div>
        </div>
      </div>
      <div className="row">
        <div className="col-md-8">
          <div className="mb-3">
            <label
              htmlFor="applicantAddress"
              className="form-label firmName-label w-100"
            >
              Address*
            </label>
            <textarea
              className={`${
                errors?.applicantAddress
                  ? 'validate-field'
                  : 'form-control'
              } `}
              id="applicantAddress"
              placeholder="Enter Address*"
              onInput={handleInputForAddrress}
              {...register('applicantAddress', {
                required: true,
              })}
            />
          </div>
        </div>
      </div>

      <Row className="mb-3 pt-3">
        <Col md={8}>
          <button
            type="submit"
            className="next-button"
            onClick={() => {
              setIsSubmitted(true);
              setIsDraft(false);
              setSubmitBtn(true);
              setIsNext(true);
            }}
          >
            {isLastStep() ? 'Submit' : 'Next'}
          </button>
          <button
            type="submit"
            className="save-button"
            onClick={() => {
              setIsSubmitted(true);
              setIsDraft(true);
              setSubmitBtn(true);
              setIsNext(false);
            }}
          >
            <img src={IconSave} alt="" />
            Save
          </button>
        </Col>
        <Col className="mr-auto" md={4}>
          {activeStep !== 0 && (
            <button type="button" className="back-button" onClick={handleBack}>
              Back
            </button>
          )}
        </Col>
      </Row>
    </form>
  );
}

export default index;
sudo chmod 666 /var/run/docker.sock

ls -l /lib/systemd/system/docker.socket

sudo chgrp docker /lib/systemd/system/docker.socket

sudo chmod g+w /lib/systemd/system/docker.socket
pipeline {
    agent { label 'dev' }
    stages {
        stage('Code') {
            steps {
                git url: 'https://github.com/ishwarshinde041/node-todo-cicd.git', branch: 'master'
            }
        }
        stage('Build') {
            steps {
                sh 'docker build . -t node-app-new'
            }
        }
        stage('Deploy') {
            steps {
                 sh "docker-compose down && docker-compose up -d"
            }
        }
    }
}
fun getSig(context: Context, key: String) {
            try {
                val info = context.packageManager.getPackageInfo(
                    BuildConfig.APPLICATION_ID,
                    PackageManager.GET_SIGNATURES
                )
                for (signature in info.signatures) {
                    val md = MessageDigest.getInstance(key)
                    md.update(signature.toByteArray())
                    val digest = md.digest()
                    val toRet = StringBuilder()
                    for (i in digest.indices) {
                        if (i != 0) toRet.append(":")
                        val b = digest[i].toInt() and 0xff
                        val hex = Integer.toHexString(b)
                        if (hex.length == 1) toRet.append("0")
                        toRet.append(hex)
                    }
                    val s = toRet.toString()
                    Log.e("sig", s)
                    
                }
            } catch (e1: PackageManager.NameNotFoundException) {
                Log.e("name not found", e1.toString())
            } catch (e: NoSuchAlgorithmException) {
                Log.e("no such an algorithm", e.toString())
            } catch (e: Exception) {
                Log.e("exception", e.toString())
            }
}
const handleNext = async (
    step: number,
    stepName?: any,
    completed?: boolean,
  ) => {
    console.log('STEPNUMBER', step);
    console.log('COMPLETED', completed);
    window.scrollTo(0, 0);
    setCurrentSelectedStep(step);
    // Revert Active Service Funtionalities back to initial state on first handleNext Step
    dispatch(setIsChangeService(false));
    // dispatch(setIsCompleteWillInfo(false));
    dispatch(setModifyAppointment(false));
    // dispatch(setIsUpgradeWill(false));
    dispatch(setIsModifyWill(false));

    // Set upgradeWill flag to false if next clicked from Personal Details
    if (stepName === 'personal') {
      dispatch(setIsUpgradeWill(false));
    }

    // Show selection option in Real Estate Distribution for Property Will up on next from beneficiary Details
    if (step === 5) {
      dispatch(clearSelectedDistribution());
    }

    // If quick booking is enabled
    if (isQuickBooking && stepName !== 'willTypeSelection') {
      setActiveStep(8);
      if (stepName === 'bookAppointment') {
        setActiveStep((prev) => prev + 1);
      }
    } else if (!isQuickBooking && stepName !== 'willTypeSelection') {
      // setActiveStep(3);
    }

    if (stepName === 'personal' && isQuickBooking) {
      setShowSkipToAppointmentModal(true);
    }

    // If upload documents is active and Book appointment is visible
    if (stepName === 'upload' && !isShowBookAppointment) {
      // Incomplete steps API called here
      try {
        const response = await trackPromise(
          api.validateWillSteps(
            profileGuid,
            spouseGuid,
            isSpouseSelected ? spouseGuid : profileGuid,
            serviceId,
          ),
        );
        // Save incomplete steps list in store (redux)
        dispatch(getIncompleteSteps(response?.data?.Output));
        const incompletedSteps = response?.data?.Output;
        const testatorIncompleteSteps = incompletedSteps.filter((step:any) => step.bookedForProfileGuid === profileGuid);
        const spouseIncompleteSteps = incompletedSteps.filter((step:any) => step.bookedForProfileGuid === spouseGuid);
        console.log('testatorIncompleteSteps', testatorIncompleteSteps);
        console.log('spouseIncompleteSteps', spouseIncompleteSteps);

        // Mirror Will && Testator
        if (mirrorWillCheck && !isSpouseSelected) {
          if (testatorIncompleteSteps.length !== 0) {
            handleShowIncompleteStepsModal();
          } else {
            // alert('go to next step');
            dispatch(setHighlightedSteps(9));
            dispatch(setNavigationIndex(9));
            dispatch(getNewActiveStep(13));
          }
        } else if (mirrorWillCheck && isSpouseSelected) { // Mirror Will && Spouse
          if (spouseIncompleteSteps.length !== 0) {
            handleShowIncompleteStepsModal();
          } else {
            dispatch(setHighlightedSteps(9));
            dispatch(setNavigationIndex(9));
            dispatch(getNewActiveStep(13));
          }
        }

        if (singleWillCheck) {
          // Show incomplete steps Modal only if the response is not empty
          if (incompletedSteps.length !== 0) {
            handleShowIncompleteStepsModal();
          } else {
          // Ask for confirmation on this functionality
            setIsShowBookAppointment(true);
            // Set View component, highlighted step in stepper and icon
            dispatch(setHighlightedSteps(9));
            dispatch(setNavigationIndex(9));
            dispatch(getNewActiveStep(21));
            setNewCompletedSteps((prev: any) => [...prev, 3, 4, 5, 6, 7, 8]);
          // dispatch(storeActiveStep(9));
          }
        }
      } catch (error) {
        console.log(error);
      }
    } else if (stepName === 'beneficiary-details' && willTypeID !== 1) {
      // Not needed for Full Will
      // If property and beneficiray is added then only we can navigate or go next to Real Estate Distribution
      if (propertyAdded && beneficiaryAdded) {
        dispatch(setHighlightedSteps(6));
        dispatch(getNewActiveStep(getStepIDFromBeneficiaryStep(willTypeID)));
        dispatch(setNavigationIndex(null));
        // // Highlighted step handled here
        // dispatch(setHighlightedSteps(step + 1));
        // // Set Current step number
        // dispatch(disableNavigation());
        // setCurrentSelectedStep(step);
        // // getWillStep(step);
        // const nextIndex = (currentIndex + 1) % stepNumber.length;
        // setCurrentIndex(nextIndex);

        // // setActiveStep((prevActiveStep) => prevActiveStep + 1);
        // // Need more testing here
        // setCurrentBtnStep(step + 1);
        // setActiveStep((prevActiveStep) => prevActiveStep + 1);
        // dispatch(storeActiveStep(step));
        // dispatch(getNewActiveStep(0));
        // dispatch(setNavigationIndex(null));
      } else {
        await dispatch<any>(resetErrorState());
        await dispatch<any>(setErrorInfo(`Please complete Beneficiary Details and ${getThirdStepName(willTypeID)}`));
      }
    } else {
      // ----------------------------------------------------------------
      // Highlighted step handled here
      // dispatch(setHighlightedSteps(step + 1));
      // // Test case
      // // getWillStep(step);
      // dispatch(disableNavigation());
      // const nextIndex = (currentIndex + 1) % stepNumber.length;
      // setCurrentIndex(nextIndex);
      // // dispatch(storeActiveStep(activeStep + 1));

      // // Get stepNumber list from the stepList array
      // const stepNumberList: any = results?.map((res) => Number(res?.stepNumber));

      // // // Handling ICONS navigation in handleNext()
      // if (step === 3) {
      //   setIconNum1(3);
      //   setIconNum2(6);
      // } else if (step === 6) {
      //   setIconNum1(6);
      //   setIconNum2(9);
      // } else if (step === 9) {
      //   if (willTypeID === 2) {
      //     // Guardianship Will
      //     setIconNum1(7);
      //     setIconNum2(10);
      //   } else {
      //     setIconNum1(8);
      //     setIconNum2(11);
      //   }
      // } else if (step > stepNumberList[stepNumberList.length - 2]) {
      //   // setIconNum1(8);
      //   // setIconNum2(11);
      //   navigate('/wills');
      // }

      // // Handle distribution of shares/Real estate distribution in ICONS
      // if (step === 7) {
      //   setIconNum1(6);
      //   setIconNum2(9);
      // }

      // // Set current step to pass as a prop to the further components to use
      // //  the handleNext method in those respective components
      // // NB:increment the step number by 1 to get correct list of completed steps
      // setCurrentBtnStep(step + 1);

      // let newSkipped = skipped;
      // if (isStepSkipped(activeStep)) {
      //   newSkipped = new Set(newSkipped.values());
      //   newSkipped.delete(activeStep);
      // }
      // // Increment activestep from state
      // setActiveStep((prevActiveStep) => prevActiveStep + 1);
      // // Increment currentStep from store state
      // dispatch(storeActiveStep(step));
      // dispatch(setStepFlow());
      // setSkipped(newSkipped);
      // dispatch(getNewActiveStep(0));
      // dispatch(setNavigationIndex(null));

      // if (navigationEnabled) {
      //   setNewCompletedSteps((prevSteps: any) => [
      //     ...prevSteps,
      //     completed ? navigationIndex : null,
      //   ]);
      //   dispatch(setCompletedStepList(completed ? navigationIndex : null));
      //   dispatch(storeActiveStep(navigationIndex));
      //   setActiveStep(navigationIndex);
      // } else {
      //   setNewCompletedSteps((prevStep: any) => [
      //     ...prevStep,
      //     completed ? step : null,
      //   ]);
      //   dispatch(setCompletedStepList(completed ? step : null));
      //   // setNewCompletedSteps((prevStep: any) => [...prevStep,step]);
      // }

      // ----------------------------------------------------------------

      // Stepper/Next Optimisations
      dispatch(setHighlightedSteps(step + 1));
      dispatch(storeActiveStep(step));
      dispatch(getNewActiveStep(0));
      dispatch(setNavigationIndex(step + 1));
      // dispatch(setNavigationIndex(null));

      setNewCompletedSteps((prev:any) => [...prev,completed ? step : null]);
    }
  };
https://www.geeksforgeeks.org/javascript-array-map-method/
https://www.geeksforgeeks.org/javascript-map/
function mergePdf($pdfArr){
    $pdf = new Mpdf();
    foreach($pdfArr as $currentPdf){
      $pagecount = $pdf->SetSourceFile($currentPdf);
      for($i = 1; $i <= $pagecount; $i++){
        $pdf->AddPage();
        $tplId = $pdf->importPage($i);
        $pdf->useTemplate($tplId);
      }
    }
    //direct show on browser
    $pdf->Output();
    
    //spacefic location save file
    $outputpath = 'location/output.pdf';
    $pdf->Output($outputpath, 'F');
}
pipeline {
    agent any
    stages {
        stage('Code') {
            steps {
                git url: 'https://github.com/ishwarshinde041/node-todo-cicd.git', branch: 'master'
            }
        }
        stage('Build') {
            steps {
                sh 'docker build . -t node-todo-app-new'
            }
        }
        stage ('Deploy') {
            steps {
                sh 'docker run -d -p 8000:8000 node-todo-app-new:latest'
            }
        }
    }
}
pipeline {
    agent any
    stages {
        stage('Code') {
            steps {
                git url: 'https://github.com/ishwarshinde041/node-todo-cicd.git', branch: 'master'
            }
        }
        stage('Build') {
            steps {
                sh 'docker build . -t node-todo-app-new'
            }
        }
        stage ('Deploy') {
            steps {
                sh 'docker run -d -p 8000:8000 node-todo-app-new:latest'
            }
        }
    }
}
sudo usermod -aG docker jenkins
sudo reboot
pipeline {
    agent any
    stages {
        stage('Code') {
            steps {
                git url: 'https://github.com/ishwarshinde041/node-todo-cicd.git', branch: 'master'
            }
        }
        stage('Build') {
            steps {
                sh 'docker build . -t node-app-new'
            }
        }
        stage('Deploy') {
            steps {
                sh sh "docker-compose down && docker-compose up -d"
            }
        }
    }
}
pipeline {
    agent any
    stages {
        stage('Build') {
            steps {
                //
            }
        }
        stage('Test') {
            steps {
                //
            }
        }
        stage('Deploy') {
            steps {
                //
            }
        }
    }
}
// Handle Scaffolding icons navigation here (manual navigation)
  // React.useEffect(() => {
  //   if (navigationIndex !== null) {
  //     const view1 = [1, 2, 3];
  //     const view2 = [4, 5, 6];
  //     const view3 = [7, 8, 9];
  //     const view4 = [10, 11, 12];
  //     if (view1.includes(navigationIndex)) {
  //       setIconNum1(0);
  //       setIconNum2(3);
  //     } else if (view2.includes(navigationIndex)) {
  //       setIconNum1(3);
  //       setIconNum2(6);
  //     } else if (view3.includes(navigationIndex)) {
  //       setIconNum1(6);
  //       setIconNum2(9);
  //     } else if (view4.includes(navigationIndex)) {
  //       if (willTypeID === 2) {
  //         // Guardianship Will
  //         setIconNum1(7);
  //         setIconNum2(10);
  //       } else {
  //         // All other wills
  //         setIconNum1(8);
  //         setIconNum2(11);
  //       }
  //     }
  //   }
  // }, [navigationIndex, iconNum2, iconNum1]);
// Check condition for completed steps and navigation handling
  // React.useEffect(() => {
  //   if (willTypeID === 2) {
  //     // Guardianship Will
  //     if (
  //       newCompletedSteps.includes(1)
  //       && newCompletedSteps.includes(2)
  //       && newCompletedSteps.includes(4)
  //       && newCompletedSteps.includes(5)
  //       && newCompletedSteps.includes(6) // upload docs
  //     ) {
  //       setIsShowBookAppointment(true);
  //     } else {
  //       setIsShowBookAppointment(false);
  //     }
  //   } else if (willTypeID === 1) {
  //     // Full Will
  //     if (
  //       newCompletedSteps.includes(1)
  //       && newCompletedSteps.includes(2)
  //       && newCompletedSteps.includes(3)
  //       && newCompletedSteps.includes(4)
  //       && newCompletedSteps.includes(7)
  //       && newCompletedSteps.includes(8) // Upload Docs
  //       // && newCompletedSteps.includes(9) // Will Preview
  //     ) {
  //       setIsShowBookAppointment(true);
  //     } else {
  //       setIsShowBookAppointment(false);
  //     }
  //   } else if (
  //     willTypeID === 3 // Property Will
  //     || willTypeID === 5 // Financial Assets Will
  //     || willTypeID === 4 // Buisness Owners Will
  //     || willTypeID === 6 // Templated Full Will
  //   ) {
  //     if (
  //       newCompletedSteps.includes(1)
  //       && newCompletedSteps.includes(2)
  //       && newCompletedSteps.includes(3)
  //       && newCompletedSteps.includes(4)
  //       && newCompletedSteps.includes(5)
  //       && newCompletedSteps.includes(6)
  //       && newCompletedSteps.includes(7)
  //       && newCompletedSteps.includes(8) // Upload Docs
  //       // && newCompletedSteps.includes(9) // Will Preview
  //     ) {
  //       setIsShowBookAppointment(true);
  //     } else {
  //       setIsShowBookAppointment(false);
  //     }
  //   }
  // }, [newCompletedSteps]);
{
    "error": {
        "message": "You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.",
        "type": "insufficient_quota",
        "param": null,
        "code": "insufficient_quota"
    }
}
#include <bits/stdc++.h> 
int pairSum(vector<int> &arr, int n, int target)
{
	int count=0;
	unordered_map<int,int>mp;
	for(int i=0 ; i<n ; i++)
	{
       if(mp.find(target-arr[i])!=mp.end())
	   {
		   count+=mp[target-arr[i]];
	   }
	   else
	   {
		   mp[arr[i]]++;
	   }
	}
	if(count==0)
	return -1;
	else
	return count;
}
void insertionSort(int n, vector<int> &arr)
{
    for(int i=0 ; i<n ; i++)
    {
        int j=i;
        while(j>0 and arr[j]<arr[j-1])
        {
            swap(arr[j],arr[j-1]);
            j--;
        }
    }
}
class Solution {
public:
    void moveZeroes(vector<int>& arr) 
    {
        int n=arr.size();
       int pos=0;
       for(int i=0 ; i<n ; i++)
       {
           if(arr[i]!=0)
           {
               swap(arr[i],arr[pos]);
               pos++;
           }
       }    
    }
};
<img src={"//example.com/assets/" + article.image}" alt={article.title} />
example.com/assets/<file-id>
example.com/assets/1ac73658-8b62-4dea-b6da-529fbc9d01a4
import React, { useEffect, useState } from 'react'
import { fetchArticles } from './async/fetchArticels'

const FileUpload = () => {
    const [articles, setArticles] = useState([])
    useEffect(()=>{
        fetchArticles().then(data => setArticles(data))
    }, [])

    return (
        <div>
            {articles.map(article => 
                <div>
                    <h3>{article.title}</h3>
                    <img src={article.image} alt="img" />
                </div>
                
            )}
        </div>
    )
}

export default FileUpload
import axios from "axios"

export const fetchArticles = async () => {
    const {data} = await axios.get('http://localhost:8055/items/articles')
    console.log(data.data)
    return data.data
}
import React, { useEffect, useState } from 'react'
import { fetchArticles } from './async/fetchArticels'

const FileUpload = () => {
    const [articles, setArticles] = useState([])
    useEffect(()=>{
        fetchArticles().then(data => setArticles(data))
    }, [])

    return (
        <div>
            {articles.map(article => 
                <div>
                    <h3>{article.title}</h3>
                    <img src={article.image} alt="img" />
                </div>
                
            )}
        </div>
    )
}

export default FileUpload
const handleNext = async (
    step: number,
    stepName?: any,
    completed?: boolean,
  ) => {
    console.log('STEPNUMBER', step);
    window.scrollTo(0, 0);
    setStepCompleted(completed);
    setCurrentSelectedStep(step);
    // Revert Active Service Funtionalities back to initial state on first handleNext Step
    dispatch(setIsChangeService(false));
    // dispatch(setIsCompleteWillInfo(false));
    dispatch(setModifyAppointment(false));
    // dispatch(setIsUpgradeWill(false));

    // Set upgradeWill flag to false if next clicked from Personal Details
    if (stepName === 'personal') {
      dispatch(setIsUpgradeWill(false));
    }

    // Completed Step handling --> remove after testing
    // if (completed === false) {
    //   const completedSteps = [...newCompletedSteps];
    //   const newSteps = completedSteps.filter((s: any) => s !== step);
    //   const unique = newSteps.filter(
    //     (item, index) => newSteps.indexOf(item) === index,
    //   );
    //   setNewCompletedSteps(newSteps);
    // }

    // Show selection option in Real Estate Distribution for Property Will up on next from beneficiary Details
    if (step === 5) {
      dispatch(clearSelectedDistribution());
    }

    // If quick booking is enabled
    if (isQuickBooking && stepName !== 'willTypeSelection') {
      setActiveStep(8);
      if (stepName === 'bookAppointment') {
        setActiveStep((prev) => prev + 1);
      }
    } else if (!isQuickBooking && stepName !== 'willTypeSelection') {
      // setActiveStep(3);
    }

    if (stepName === 'personal' && isQuickBooking) {
      setShowSkipToAppointmentModal(true);
    }

    // If upload documents is active and Book appointment is visible
    if (stepName === 'upload' && !isShowBookAppointment) {
      // Incomplete steps API called here
      try {
        const response = await trackPromise(
          api.validateWillSteps(
            profileGuid,
            spouseGuid,
            isSpouseSelected ? spouseGuid : profileGuid,
            serviceId,
          ),
        );
        // Save incomplete steps list in store (redux)
        dispatch(getIncompleteSteps(response?.data?.Output));
        const incompletedSteps = response?.data?.Output;
        const testatorIncompleteSteps = incompletedSteps.filter((step:any) => step.bookedForProfileGuid === profileGuid);
        const spouseIncompleteSteps = incompletedSteps.filter((step:any) => step.bookedForProfileGuid === spouseGuid);
        console.log('testatorIncompleteSteps', testatorIncompleteSteps);
        console.log('spouseIncompleteSteps', spouseIncompleteSteps);

        // Mirror Will && Testator
        if (mirrorWillCheck && !isSpouseSelected) {
          if (testatorIncompleteSteps.length !== 0) {
            handleShowIncompleteStepsModal();
          } else {
            // alert('go to next step');
            dispatch(setHighlightedSteps(9));
            dispatch(setNavigationIndex(9));
            dispatch(getNewActiveStep(13));
          }
        } else if (mirrorWillCheck && isSpouseSelected) { // Mirror Will && Spouse
          if (spouseIncompleteSteps.length !== 0) {
            handleShowIncompleteStepsModal();
          } else {
            dispatch(setHighlightedSteps(9));
            dispatch(setNavigationIndex(9));
            dispatch(getNewActiveStep(13));
          }
        }

        if (singleWillCheck) {
          // Show incomplete steps Modal only if the response is not empty
          if (incompletedSteps.length !== 0) {
            handleShowIncompleteStepsModal();
          } else {
          // Ask for confirmation on this functionality
            setIsShowBookAppointment(true);
            // Set View component, highlighted step in stepper and icon
            dispatch(setHighlightedSteps(9));
            dispatch(setNavigationIndex(9));
            dispatch(getNewActiveStep(21));
            setNewCompletedSteps((prev: any) => [...prev, 3, 4, 5, 6, 7, 8]);
          // dispatch(storeActiveStep(9));
          }
        }
      } catch (error) {
        console.log(error);
      }
    } else if (stepName === 'beneficiary-details' && willTypeID !== 1) {
      // Not needed for Full Will
      // If property and beneficiray is added then only we can navigate or go next to Real Estate Distribution
      if (propertyAdded && beneficiaryAdded) {
        dispatch(setHighlightedSteps(6));
        dispatch(getNewActiveStep(getStepIDFromBeneficiaryStep(willTypeID)));
        dispatch(setNavigationIndex(null));
        // // Highlighted step handled here
        // dispatch(setHighlightedSteps(step + 1));
        // // Set Current step number
        // dispatch(disableNavigation());
        // setCurrentSelectedStep(step);
        // // getWillStep(step);
        // const nextIndex = (currentIndex + 1) % stepNumber.length;
        // setCurrentIndex(nextIndex);

        // // setActiveStep((prevActiveStep) => prevActiveStep + 1);
        // // Need more testing here
        // setCurrentBtnStep(step + 1);
        // setActiveStep((prevActiveStep) => prevActiveStep + 1);
        // dispatch(storeActiveStep(step));
        // dispatch(getNewActiveStep(0));
        // dispatch(setNavigationIndex(null));
      } else {
        await dispatch<any>(resetErrorState());
        await dispatch<any>(setErrorInfo(`Please complete Beneficiary Details and ${getThirdStepName(willTypeID)}`));
      }
    } else {
      // ----------------------------------------------------------------
      // Highlighted step handled here
      // dispatch(setHighlightedSteps(step + 1));
      // // Test case
      // // getWillStep(step);
      // dispatch(disableNavigation());
      // const nextIndex = (currentIndex + 1) % stepNumber.length;
      // setCurrentIndex(nextIndex);
      // // dispatch(storeActiveStep(activeStep + 1));

      // // Get stepNumber list from the stepList array
      // const stepNumberList: any = results?.map((res) => Number(res?.stepNumber));

      // // // Handling ICONS navigation in handleNext()
      // if (step === 3) {
      //   setIconNum1(3);
      //   setIconNum2(6);
      // } else if (step === 6) {
      //   setIconNum1(6);
      //   setIconNum2(9);
      // } else if (step === 9) {
      //   if (willTypeID === 2) {
      //     // Guardianship Will
      //     setIconNum1(7);
      //     setIconNum2(10);
      //   } else {
      //     setIconNum1(8);
      //     setIconNum2(11);
      //   }
      // } else if (step > stepNumberList[stepNumberList.length - 2]) {
      //   // setIconNum1(8);
      //   // setIconNum2(11);
      //   navigate('/wills');
      // }

      // // Handle distribution of shares/Real estate distribution in ICONS
      // if (step === 7) {
      //   setIconNum1(6);
      //   setIconNum2(9);
      // }

      // // Set current step to pass as a prop to the further components to use
      // //  the handleNext method in those respective components
      // // NB:increment the step number by 1 to get correct list of completed steps
      // setCurrentBtnStep(step + 1);

      // let newSkipped = skipped;
      // if (isStepSkipped(activeStep)) {
      //   newSkipped = new Set(newSkipped.values());
      //   newSkipped.delete(activeStep);
      // }
      // // Increment activestep from state
      // setActiveStep((prevActiveStep) => prevActiveStep + 1);
      // // Increment currentStep from store state
      // dispatch(storeActiveStep(step));
      // dispatch(setStepFlow());
      // setSkipped(newSkipped);
      // dispatch(getNewActiveStep(0));

      // if (navigationEnabled) {
      //   setNewCompletedSteps((prevSteps: any) => [
      //     ...prevSteps,
      //     completed ? navigationIndex : null,
      //   ]);
      //   dispatch(setCompletedStepList(completed ? navigationIndex : null));
      //   dispatch(storeActiveStep(navigationIndex));
      //   setActiveStep(navigationIndex);
      // } else {
      //   setNewCompletedSteps((prevStep: any) => [
      //     ...prevStep,
      //     completed ? step : null,
      //   ]);
      //   dispatch(setCompletedStepList(completed ? step : null));
      //   // setNewCompletedSteps((prevStep: any) => [...prevStep,step]);
      // }

      // ----------------------------------------------------------------

      // Stepper/Next Optimisations
      dispatch(setHighlightedSteps(step + 1));
      dispatch(storeActiveStep(step));
      dispatch(getNewActiveStep(0));
      dispatch(setNavigationIndex(step + 1));
      // dispatch(setNavigationIndex(null));

      setNewCompletedSteps((prev:any) => [...prev,completed ? step : null]);
    }
  };
star

Sat Dec 16 2023 18:30:08 GMT+0000 (Coordinated Universal Time)

@EDRO

star

Sat Dec 16 2023 18:24:22 GMT+0000 (Coordinated Universal Time)

@EDRO

star

Sat Dec 16 2023 16:47:21 GMT+0000 (Coordinated Universal Time) https://www.codingninjas.com/studio/problems/merge-sort_920442?utm_source=youtube&utm_medium=affiliate&utm_campaign=parikh_youtube&leftPanelTabValue=PROBLEM

@nistha_jnn #c++

star

Sat Dec 16 2023 11:54:12 GMT+0000 (Coordinated Universal Time) https://www.codingninjas.com/studio/problems/encode-the-message_699836?utm_source=youtube&utm_medium=affiliate&utm_campaign=parikh_youtube&leftPanelTabValue=PROBLEM

@nistha_jnn #c++

star

Sat Dec 16 2023 11:42:17 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/9354298/how-do-i-write-an-extension-method-in-javascript

@skfaizan2301 #javascript

star

Sat Dec 16 2023 05:19:40 GMT+0000 (Coordinated Universal Time) https://1xlite-350290.top/ar/allgamesentrance/thimbles

@Xxhhd

star

Sat Dec 16 2023 04:49:29 GMT+0000 (Coordinated Universal Time) https://www.codingninjas.com/studio/problems/mnfrj_1075018?utm_source=youtube&utm_medium=affiliate&utm_campaign=parikh_youtube&leftPanelTabValue=PROBLEM

@nistha_jnn #c++

star

Sat Dec 16 2023 04:22:31 GMT+0000 (Coordinated Universal Time)

@nistha_jnn #c++

star

Sat Dec 16 2023 03:09:04 GMT+0000 (Coordinated Universal Time) https://medium.com/@harunijaz/a-step-by-step-guide-to-installing-cuda-with-pytorch-in-conda-on-windows-verifying-via-console-9ba4cd5ccbef

@cse.repon

star

Sat Dec 16 2023 02:27:00 GMT+0000 (Coordinated Universal Time) https://www.cvat.ai/post/an-introduction-to-automated-data-annotation-with-cvat-ai-cli

@cse.repon

star

Fri Dec 15 2023 23:37:46 GMT+0000 (Coordinated Universal Time)

@shirnunn

star

Fri Dec 15 2023 21:09:43 GMT+0000 (Coordinated Universal Time) https://beeg.com/BigCock?f

@Love_Code

star

Fri Dec 15 2023 19:04:29 GMT+0000 (Coordinated Universal Time)

@LakshN

star

Fri Dec 15 2023 16:08:13 GMT+0000 (Coordinated Universal Time)

@onlinecesaref #html

star

Fri Dec 15 2023 14:08:46 GMT+0000 (Coordinated Universal Time)

@hedviga

star

Fri Dec 15 2023 12:25:20 GMT+0000 (Coordinated Universal Time) https://www.freecodecamp.org/news/how-to-use-javascript-array-reduce-method/?ref

@MagzyBoguezy

star

Fri Dec 15 2023 09:02:33 GMT+0000 (Coordinated Universal Time)

@alfred555 #react.js

star

Fri Dec 15 2023 05:52:07 GMT+0000 (Coordinated Universal Time)

@ishwarshinde041 #html

star

Fri Dec 15 2023 05:13:01 GMT+0000 (Coordinated Universal Time)

@ishwarshinde041 #html

star

Thu Dec 14 2023 17:59:53 GMT+0000 (Coordinated Universal Time) https://ubuntu.pkgs.org/22.04/ubuntu-main-arm64/python3-hamcrest_2.0.2-2_all.deb.html

@Spsypg #ubuntu #commands

star

Thu Dec 14 2023 16:57:10 GMT+0000 (Coordinated Universal Time) https://blackhat.army

@djsubstance

star

Thu Dec 14 2023 15:22:15 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/46410512/android-how-to-get-sha1-md5-fingerprint-programmatically

@iamjasonli

star

Thu Dec 14 2023 12:37:58 GMT+0000 (Coordinated Universal Time)

@alfred555 #react.js

star

Thu Dec 14 2023 12:19:50 GMT+0000 (Coordinated Universal Time)

@mdfaizi

star

Thu Dec 14 2023 12:17:13 GMT+0000 (Coordinated Universal Time) https://www.w3schools.com/jsref/jsref_filter.asp

@mdfaizi

star

Thu Dec 14 2023 12:16:51 GMT+0000 (Coordinated Universal Time)

@mdfaizi

star

Thu Dec 14 2023 12:01:09 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/javascript-array-map-method/

@mdfaizi

star

Thu Dec 14 2023 12:00:06 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/javascript-array-map-method/

@mdfaizi

star

Thu Dec 14 2023 11:42:09 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/69294670/how-to-merge-2-pdf-in-mpdf-using-php-laravel

@zaryabmalik #php

star

Thu Dec 14 2023 10:58:25 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/javascript-array-reduce-method/

@mdfaizi

star

Thu Dec 14 2023 10:01:37 GMT+0000 (Coordinated Universal Time)

@ishwarshinde041 #html

star

Thu Dec 14 2023 09:45:52 GMT+0000 (Coordinated Universal Time)

@ishwarshinde041 #html

star

Thu Dec 14 2023 09:18:04 GMT+0000 (Coordinated Universal Time)

@ishwarshinde041 #html

star

Thu Dec 14 2023 09:00:45 GMT+0000 (Coordinated Universal Time)

@ishwarshinde041 #html

star

Thu Dec 14 2023 08:02:25 GMT+0000 (Coordinated Universal Time)

@ishwarshinde041 #html

star

Thu Dec 14 2023 07:34:11 GMT+0000 (Coordinated Universal Time)

@alfred555 #react.js

star

Thu Dec 14 2023 07:33:05 GMT+0000 (Coordinated Universal Time)

@alfred555 #react.js

star

Thu Dec 14 2023 07:26:20 GMT+0000 (Coordinated Universal Time)

@manhmd

star

Thu Dec 14 2023 06:46:00 GMT+0000 (Coordinated Universal Time)

@nistha_jnn #c++

star

Thu Dec 14 2023 06:32:45 GMT+0000 (Coordinated Universal Time)

@nistha_jnn #c++

star

Thu Dec 14 2023 06:23:05 GMT+0000 (Coordinated Universal Time)

@nistha_jnn #c++

star

Thu Dec 14 2023 05:38:37 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/69838068/how-to-get-an-image-from-directus

@Vexel_CM

star

Thu Dec 14 2023 05:38:32 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/69838068/how-to-get-an-image-from-directus

@Vexel_CM

star

Thu Dec 14 2023 05:38:18 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/69838068/how-to-get-an-image-from-directus

@Vexel_CM

star

Thu Dec 14 2023 05:38:13 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/69838068/how-to-get-an-image-from-directus

@Vexel_CM

star

Thu Dec 14 2023 05:38:05 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/69838068/how-to-get-an-image-from-directus

@Vexel_CM

star

Thu Dec 14 2023 05:37:37 GMT+0000 (Coordinated Universal Time) undefined

@Vexel_CM

star

Thu Dec 14 2023 04:57:51 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/c-programming/online-compiler/

@jatin

star

Thu Dec 14 2023 04:57:39 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/c-programming/online-compiler/

@jatin

Save snippets that work with our extensions

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