Snippets Collections
mongod --dbpath=data - set the database and run
mongo - mongosh

db
use nucampsite
db
db.help()


Next, create a collection named campsites, and insert a new campsite document in the collection: 
db.campsites.insert({ name: "React Lake Campground", description: "Test" });

Then to print out the campsites in the collection, type: 
db.campsites.find().pretty();

Note the "_id" that was automatically assigned to the campsite. 
Next, we will learn the information encoded into an instance of ObjectId by typing the following at the prompt: 
const id = new ObjectId();
id.getTimestamp();


To exit the REPL shell, type exit at the prompt:
exit
Keystore password = Jubna@123
<a href="https://www.securitytokenizer.io/coin-creation">Coin Creation </a> |
<a href="https://www.securitytokenizer.io/soulbound-token-development">Soulbound Token Development Company </a> |
<a href="https://www.securitytokenizer.io/whitepaper-writing-services"> White Paper Writing Services </a> |
<a href="https://www.securitytokenizer.io/smart-contract-development/"> Smart Contract Development Company </a> |


#include <iostream>

using namespace std;

int main()
{
    int year;
    char response;
    cout << "====================\n";
    cout << "== Enter the year ==\n";
    cout << "====================\n";
    cin >> year;
    
    switch (year)
    {
    case 1982:
      cout << "My Birthday\n";
      break;
    case 1989:
      cout << "My Firstwork\n";
      break;
    case 1995: 
      cout << "Windows 95\n";
      break;
    case 2000:
      cout << "Windows Millennium\n";
      break;
    case 2002:
      cout << "Created My vBulletin Forum\n";
      break;
    default:
      cout << "No Events In This Year\n";
    }
    cout << "If You Want To Continue Press [Y] , If You Want To Exit The Program Press [N]\n";
    cin >> response;
    switch (response)
    {
    case 'N':
      cout << "Thanks For Your Actions\n";
    case 'Y':
      cout << "====================\n";
      cout << "== Enter the year ==\n";
      cout << "====================\n";
      cin >> year;
    
    switch (year)
    {
    case 1982:
      cout << "My Birthday\n";
      break;
    case 1989:
      cout << "My Firstwork\n";
      break;
    case 1995: 
      cout << "Windows 95\n";
      break;
    case 2000:
      cout << "Windows Millennium\n";
      break;
    case 2002:
      cout << "Created My vBulletin Forum\n";
      break;
    default:
      cout << "No Events In This Year\n";
    }  
    }
    cout << "If You Want To Continue Press [Y] , If You Want To Exit The Program Press [N]\n";
    cin >> response;
    switch (response)
    {
    case 'N':
      cout << "Thanks For Your Actions\n";
    case 'Y':
      cout << "====================\n";
      cout << "== Enter the year ==\n";
      cout << "====================\n";
      cin >> year;
    
    switch (year)
    {
    case 1982:
      cout << "My Birthday\n";
      break;
    case 1989:
      cout << "My Firstwork\n";
      break;
    case 1995: 
      cout << "Windows 95\n";
      break;
    case 2000:
      cout << "Windows Millennium\n";
      break;
    case 2002:
      cout << "Created My vBulletin Forum\n";
      break;
    default:
      cout << "No Events In This Year\n";
    }  
    }
    cout << "If You Want To Continue Press [Y] , If You Want To Exit The Program Press [N]\n";
    cin >> response;
    switch (response)
    {
    case 'N':
      cout << "Thanks For Your Actions\n";
    case 'Y':
      cout << "====================\n";
      cout << "== Enter the year ==\n";
      cout << "====================\n";
      cin >> year;
    
    switch (year)
    {
    case 1982:
      cout << "My Birthday\n";
      break;
    case 1989:
      cout << "My Firstwork\n";
      break;
    case 1995: 
      cout << "Windows 95\n";
      break;
    case 2000:
      cout << "Windows Millennium\n";
      break;
    case 2002:
      cout << "Created My vBulletin Forum\n";
      break;
    default:
      cout << "No Events In This Year\n";
    }  
    }
    cout << "If You Want To Continue Press [Y] , If You Want To Exit The Program Press [N]\n";
    cin >> response;
    switch (response)
    {
    case 'N':
      cout << "Thanks For Your Actions\n";
    case 'Y':
      cout << "====================\n";
      cout << "== Enter the year ==\n";
      cout << "====================\n";
      cin >> year;
    
    switch (year)
    {
    case 1982:
      cout << "My Birthday\n";
      break;
    case 1989:
      cout << "My Firstwork\n";
      break;
    case 1995: 
      cout << "Windows 95\n";
      break;
    case 2000:
      cout << "Windows Millennium\n";
      break;
    case 2002:
      cout << "Created My vBulletin Forum\n";
      break;
    default:
      cout << "No Events In This Year\n";
    }  
    }
    /*
    1982 => "My Birth Day"
    1989 => "My First Work"
    1995 => "Windows 95"
    2000 => "Windows Millennium"
    2002 => "Created My vBulletin Forum"
    Any Other Year => "No Events in This Year"
    */
    return 0;
}
def pull_file(URL, savepath):
    r = requests.get(URL)
    with open(savepath, 'wb') as f:
        f.write(r.content)   
    # Use the print method for logging
    print(f"File pulled from {URL} and saved to {savepath}")

from airflow.operators.python_operator import PythonOperator

# Create the task
pull_file_task = PythonOperator(
    task_id='pull_file',
    # Add the callable
    python_callable=pull_file,
    # Define the arguments
    op_kwargs={'URL':'http://dataserver/sales.json', 'savepath':'latestsales.json'},
    dag=process_sales_dag
)
  axios.post('http://localhost:4000/events', event).catch((err) => {
    console.log(err.message);
  });
  axios.post('http://localhost:4001/events', event).catch((err) => {
    console.log(err.message);
  });
  axios.post('http://localhost:4002/events', event).catch((err) => {
    console.log(err.message);
  });
  res.send({ status: 'OK' });
lst1=[0, 00, 00, 00, 00]
2
lst2=[1,10,100,1000,10000]
3
​
4
​
5
#Type your answer here.

​

lst3=

​

​
10
print(lst3)

​

​
a=$#
echo "number of arguments are: "$a
x=$*
c=$a
res=''
while [ 1 -le $c ]
do
c=`expr $c - 1`
shift $c
res=$res' '$1
set $x
done
echo arguments in reverse order $res
<?php

$num1=10
$num2=50;

function number(){
global $num1,$num2;
return $num1+$num2;
}
echo number();

?>
clear
echo enter the basic
read basic
if [ $basic -lt 25000 ]
then
hra=`echo "scale=2; $basic * 0.1 " | bc`
da=`echo "scale=2;$basic * 0.9 " | bc`
else
hra=500
da=`echo "scale=2; $basic * 0.98 " | bc`
fi
gs=`echo "scale=2;$basic +$hra +$da " | bc`
echo "gross =" $gs
echo "hra =" $hra
<?php

function calculater($num1,$num1,$num2) {
if ($sum == "+"){
return $num1 + $num2;
}elseif ($sum == "-"){
return $num1 - $num2;
}elseif ($sum == "*"){
return $num1 * $num2;
}elseif ($sum == "/"){
return $num1 / $num2;
}else{
echo"not true value"
}
}

$number1 = 10;
$number2 = 20;
$sum="*";


echo calculater($number1,$number2,$sum);

?>
<?php

function sum($num,$num1) {
	return $num + $num1;
}

$a = 10;
$b = 20;

$ali=30
$day=50000;

echo sum($ali,$day);

?>
<?php

function Reza() {
echo "welcome";
}
Reza();

?>
<?php

for ($counter = 1; $counter <= 100; $counter= $counter + 5){
echo "Number : " . $conter . "<br>";
}

?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatib1e" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Document</title>
</head>
<body>

<select>
<option>1300</option>
<option>1301</option>
<option>1302</option>
<option>1303</option>
<option>1304</option>
<option>...</option>
<option>1400</option>
</select>

<select>

<?php
$option = 1300;
while ($option <= 1400){
echo "<option>";
echo $option;
$option++;
echo "</option>";
} ?>
</select>

</body>
</html>
<?php

$num=1;

while ($num <= 50){
echo $num . "<br>";
$num++;
}

?>
function custom_checkout_text_change( $translated_text, $text, $domain ) {
    if ( $domain === 'woocommerce' && $text === 'Billing details' ) {
        $translated_text = 'Billing Details';
    }
    return $translated_text;
}
add_filter( 'gettext', 'custom_checkout_text_change', 20, 3 );
<?php

$time=6;
switch (true){
	case $time > 7:
	echo "time is true";
	break;

	case $time < 7:
	echo "time is false";
	break;
}
?>
var validator = require('validator');

tea_email: {
            type: String,
            required: true,
            unique: true,
            lowercase: true,
            // validate: [validator.isEmail, 'Please enter a valid email']
            validate(value){
                if(!validator.isEmail(value)){
                    throw new Error('Please enter a valid email');
                }
            }
        },
$('#satuan').on('select2:select', function (e) {
        const value = $(this).val();
        
        if (value === 'new') {
            const promptValue = prompt('Tambah List:');
            
            if (promptValue) {
                const data = {
                    id: promptValue,
                    text: promptValue,
                }
                const newOption = new Option(data.text, data.id, false, false);
                $('#satuan')
                    .append(newOption)
                    .trigger('change')
                    .val(promptValue);
            }
        }
    });
using SitefinityWebApp.Extension;
using SitefinityWebApp.Mvc.Models;
using System;
using Telerik.Sitefinity.DynamicModules.Model;
using Telerik.Sitefinity.DynamicModules.PublishingSystem;
using Telerik.Sitefinity.Model;
using Telerik.Sitefinity.Publishing;

namespace SitefinityWebApp.Search
{
    public class CarouselBannerInboundPipe : DynamicContentInboundPipe
    {
        protected override void SetProperties(WrapperObject wrapperObject, DynamicContent contentItem)
        {
            base.SetProperties(wrapperObject, contentItem);
            UpdateFields(wrapperObject, contentItem);
        }

        public static void RegisterPipe()
        {
            try
            {
                var pipe = string.Format("{0}Pipe", CarouselBannerModuleBuilder.Type);
                PublishingSystemFactory.UnregisterPipe(pipe);
                PublishingSystemFactory.RegisterPipe(pipe, typeof(CarouselBannerInboundPipe));
            }
            catch (Exception ex)
            {
                Telerik.Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Writer.Write(ex.Message);
            }
        }

        public void UpdateFields(WrapperObject item, IDataItem contentItem)
        {
            try
            {
                DynamicContent content = contentItem as DynamicContent;
                item.SetOrAddProperty("si_issearch", true);
                item.SetOrAddProperty("si_urlname", content.UrlName.ToString());

                item.SetOrAddPropertyCustom4Text(content, CarouselBannerModuleBuilder.Title);
                item.SetOrAddPropertyCustom4Image(content, CarouselBannerModuleBuilder.Image, new string[] { "1080_433" });
                item.SetOrAddPropertyCustom4Image(content, CarouselBannerModuleBuilder.PortraitImage, new string[] { "1080_433" });
                item.SetOrAddPropertyCustom4ChoiceOption(content, CarouselBannerModuleBuilder.StyleOption);
                item.SetOrAddPropertyCustom4Text(content, CarouselBannerModuleBuilder.Description);
                item.SetOrAddPropertyCustom4Text(content, CarouselBannerModuleBuilder.Header);
                item.SetOrAddPropertyCustom4Text(content, CarouselBannerModuleBuilder.CTALink);
                item.SetOrAddPropertyCustom4Text(content, CarouselBannerModuleBuilder.Order);
            }
            catch (Exception ex)
            {
                Telerik.Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Writer.Write(ex.Message);
            }
        }
    }
}
@model SitefinityWebApp.Mvc.Models.CarouselBannerWidgetModel
<div class="main-carousel-parent">
    <div class="main-carousel js-main-carousel">

        @foreach (var item in Model.CarouselBannerItems)
        {
            var darkClass = item.IsDark ? "dark-banner" : "";
            <div class="slider @darkClass full-width-caption">
                <div class="item">
                    <a href="@item.CTALink">
                        <img class="visible-desktop" src="@item.ImageUrl" alt="banner" />
                        <img class="visible-non-desktop" src="@item.PortraitImageUrl" alt="banner" />

                        <div class="container caption" data-aos="fade-right" data-aos-duration="1500">
                            <h5>@item.Header</h5>
                            @if (!string.IsNullOrWhiteSpace(item.Title))
                            {
                                <h1>@item.Title</h1>
                            }
                            @if (!string.IsNullOrWhiteSpace(item.Description))
                            {
                                <p>@item.Description</p>
                            }
                        </div>
                    </a>
                </div>
            </div>
        }
    </div>
    <div class="container carousel-actions js-carousel-actions" data-aos="fade-down" data-aos-duration="1500">
        <div class="row">
            <div class="btn-group">
                @foreach (var item in Model.FeatureMenuItems)
                {
                    <div class="btn-plus">
                        <a href="@item.URL">@item.Title</a>
                    </div>
                }
            </div>

        </div>
    </div>


</div>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SitefinityWebApp.Mvc.Models
{
    public class CarouselBannerModel
    {
        public string Title { get; set; }
        public string Header { get; set; }
        public string Description { get; set; }
        //public string CTALabel { get; set; }
        public string CTALink { get; set; }
        public string ImageUrl { get; set; }
        public string PortraitImageUrl { get; set; }
        public string StyleOption { get; set; }
        public bool IsDark { get; set; }
        public int Order { get; set; }
    }

    public static class CarouselBannerModuleBuilder
    {
        public const string Type = "Telerik.Sitefinity.DynamicTypes.Model.CarouselBanners.CarouselBanner";
        public const string IndexName = "carouselbanner";
        public const string Id = "Id";
        public const string Title = "title";
        public const string Header = "header";
        public const string Description = "description";
        public const string Order = "order";
        //public const string CTALabel = "ctalabel";
        public const string CTALink = "url";
        public const string Image = "image";
        public const string StyleOption = "styleoption";
        public const string PortraitImage = "portraitimage";
    }

}
using Newtonsoft.Json;
using SitefinityWebApp.Mvc.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Telerik.Sitefinity.Abstractions;
using Telerik.Sitefinity.Mvc;
using Telerik.Sitefinity.Services.Search;
using Telerik.Sitefinity.Services.Search.Data;

namespace SitefinityWebApp.Mvc.Controllers
{
    [ControllerToolboxItem(Name = "CarouselBanner", Title = "Carousel Banner", SectionName = "SBF Custom")]
    public class CarouselBannerController : Controller
    {
        public string ItemType
        {
            get
            {
                return this.itemType;
            }

            set
            {
                this.itemType = value;
            }
        }

        string itemType = CarouselBannerModuleBuilder.Type;
        public string SelectedItems { get; set; }

        public string SelectedItemIds { get; set; }



     

        public string ItemType2
        {
            get
            {
                return this.itemType2;
            }

            set
            {
                this.itemType2 = value;
            }
        }

        string itemType2 = FeaturedMenuModuleBuilder.Type;
        public string SelectedItems2 { get; set; }

        public string SelectedItemIds2 { get; set; }




        public ActionResult Index()
        {
            var result = new CarouselBannerWidgetModel();

            var service = Telerik.Sitefinity.Services.ServiceBus.ResolveService<ISearchService>();
            var queryBuilder = ObjectFactory.Resolve<IQueryBuilder>();

            GetCarouselBanner(result, service, queryBuilder);
            GetFeaturedMenu(result, service, queryBuilder);
            return View(result);
        }

        private void GetCarouselBanner(CarouselBannerWidgetModel result, ISearchService service, IQueryBuilder queryBuilder)
        {
            var keysearch = string.Format("({0})", "true");
            var searchQuery = queryBuilder.BuildQuery(keysearch, new[] { "si_issearch" });
            searchQuery.IndexName = CarouselBannerModuleBuilder.IndexName;

            #region Compose where clause
            if (!string.IsNullOrWhiteSpace(this.SelectedItemIds))
            {
                var ids = JsonConvert.DeserializeObject<Guid[]>(this.SelectedItemIds).ToList();
                if (ids != null && ids.Count > 0)
                {
                    var testimonialTypeGroup = new SearchQueryGroup();
                    testimonialTypeGroup.Operator = QueryOperator.Or;
                    foreach (var value in ids)
                    {
                        testimonialTypeGroup.AddTerm(new SearchTerm()
                        {
                            Field = CarouselBannerModuleBuilder.Id,
                            Value = string.Format("({0})", value)
                        });
                    }
                    var searchGroup = searchQuery.SearchGroup;
                    searchQuery.SearchGroup = new SearchQueryGroup
                    {
                        Groups = new[] { searchGroup, testimonialTypeGroup },
                        Operator = QueryOperator.And
                    };
                }
            }
            #endregion

            List<IDocument> finalResult = null;
            IEnumerable<IDocument> whereItems = null;

            whereItems = service.Search(searchQuery);
            finalResult = whereItems.ToList();

            for (int i = 0; i < finalResult.Count(); i++)
            {
                CarouselBannerModel modelItem = new CarouselBannerModel();
                modelItem = ComposeBannerSlider(finalResult[i]);
                result.CarouselBannerItems.Add(modelItem);
            }
            result.CarouselBannerItems = result.CarouselBannerItems.OrderBy(t => t.Order).ToList();
        }

        private void GetFeaturedMenu(CarouselBannerWidgetModel result, ISearchService service, IQueryBuilder queryBuilder)
        {
            var keysearch = string.Format("({0})", "true");
            var searchQuery = queryBuilder.BuildQuery(keysearch, new[] { "si_issearch" });
            searchQuery.IndexName = FeaturedMenuModuleBuilder.IndexName;

            #region Compose where clause

            if (!string.IsNullOrWhiteSpace(this.SelectedItemIds2))
            {
                var ids = JsonConvert.DeserializeObject<Guid[]>(this.SelectedItemIds2).ToList();
                if (ids != null && ids.Count > 0)
                {
                    var testimonialTypeGroup = new SearchQueryGroup();
                    testimonialTypeGroup.Operator = QueryOperator.Or;
                    foreach (var value in ids)
                    {
                        testimonialTypeGroup.AddTerm(new SearchTerm()
                        {
                            Field = FeaturedMenuModuleBuilder.Id,
                            Value = string.Format("({0})", value)
                        });
                    }
                    var searchGroup = searchQuery.SearchGroup;
                    searchQuery.SearchGroup = new SearchQueryGroup
                    {
                        Groups = new[] { searchGroup, testimonialTypeGroup },
                        Operator = QueryOperator.And
                    };
                }
            }
       
            #endregion

            List<IDocument> finalResult = null;
            IEnumerable<IDocument> whereItems = null;

            whereItems = service.Search(searchQuery);
            finalResult = whereItems.ToList();

            for (int i = 0; i < finalResult.Count(); i++)
            {
                FeaturedMenuModel modelItem = new FeaturedMenuModel();
                modelItem = ComposeFeatureMenu(finalResult[i]);
                result.FeatureMenuItems.Add(modelItem);
            }
            result.FeatureMenuItems = result.FeatureMenuItems.OrderBy(t => t.Order).ToList();
        }

        private CarouselBannerModel ComposeBannerSlider(IDocument itemLive)
        {
            CarouselBannerModel bookModel = new CarouselBannerModel();
            bookModel.Title = itemLive.GetValue($"si_{CarouselBannerModuleBuilder.Title}").ToString();
            bookModel.Header = itemLive.GetValue($"si_{CarouselBannerModuleBuilder.Header}").ToString();
            bookModel.Description = itemLive.GetValue($"si_{CarouselBannerModuleBuilder.Description}").ToString();
            bookModel.CTALink = itemLive.GetValue($"si_{CarouselBannerModuleBuilder.CTALink}").ToString();
            bookModel.ImageUrl = itemLive.GetValue($"si_{CarouselBannerModuleBuilder.Image}").ToString();
            bookModel.PortraitImageUrl = itemLive.GetValue($"si_{CarouselBannerModuleBuilder.PortraitImage}").ToString();
            bookModel.StyleOption = itemLive.GetValue($"si_{CarouselBannerModuleBuilder.StyleOption}").ToString();
            bookModel.IsDark = bookModel.StyleOption == "2";
            bookModel.Order = !string.IsNullOrWhiteSpace(itemLive.GetValue($"si_{CarouselBannerModuleBuilder.Order}").ToString()) ? int.Parse(itemLive.GetValue($"si_{CarouselBannerModuleBuilder.Order}").ToString()) : int.MaxValue;

            return bookModel;
        }

        private FeaturedMenuModel ComposeFeatureMenu(IDocument itemLive)
        {
            FeaturedMenuModel bookModel = new FeaturedMenuModel();
            bookModel.Title = itemLive.GetValue($"si_{FeaturedMenuModuleBuilder.Title}").ToString();
            bookModel.URL = itemLive.GetValue($"si_{FeaturedMenuModuleBuilder.URL}").ToString();
            bookModel.Order = !string.IsNullOrWhiteSpace(itemLive.GetValue($"si_{FeaturedMenuModuleBuilder.Order}").ToString()) ? int.Parse(itemLive.GetValue($"si_{FeaturedMenuModuleBuilder.Order}").ToString()) : int.MaxValue;

            return bookModel;
        }

    }
}
In your app\http\Middleware\VerifyCsrfToken.php file.

edit $except property with:

protected $except = [
  'yourapi/*' 
];
 Save
This will exclude your api routes from CSRF verification.And keep it up for other things like your frontend.
package com.modeln.channelcollab.junit;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.modeln.channelnetwork.junit.graphql.AbstractChannelNetworkTest;
import org.apache.hc.client5.http.classic.methods.HttpPost;
import org.apache.hc.client5.http.entity.UrlEncodedFormEntity;
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
import org.apache.hc.core5.http.HttpEntity;
import org.apache.hc.core5.http.HttpResponse;
import org.apache.hc.core5.http.io.entity.EntityUtils;
import org.apache.hc.core5.http.message.BasicNameValuePair;
import org.json.JSONObject;
import org.junit.Assert;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import java.io.FileReader;
import java.io.IOException;
import java.sql.Date;
import java.util.*;

import static org.junit.Assert.assertThrows;

@ExtendWith(SpringExtension.class)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@Tag("channelcollab")
public class ChannelCollaborationUserRolesTest extends AbstractChannelNetworkTest
{

    private static String token, nucleusUsername, url, expected, testDataPath = "src/test/resources/com/modeln/cdm/junit/channelcollab/keyCloakResource.json";

    private static List expectedList;

    private static JsonObject jsonObject;

    private static String sql = "SELECT distinct JSON_OBJECT( " +
            " 'reportingPartnerId' value rp.id,  " +
            "  'reportingPartnerSid' value rp.sid , " +
            "  'reportingPartnerIp' value rp.inow_profile_sid, "+
            "  'reportingPartnerCreateDate' value rp.create_date , " +
            "  'reportingPartnerUpdateDate' value rp.update_date , " +
            "  'reportingPartnerName' value rcov.entity_name , " +
            "  'dataType' value dt.type , " +
            "  'fileType' value ft.type )" +
            "FROM " +
            "  gs_number gs " +
            "  JOIN reporting_partner rp ON rp.sid = gs.reporting_partner_sid " +
            "  JOIN user_feature_group ufg ON nvl(" +
            "    ufg.reporting_partner_sid, rp.sid" +
            "  )= rp.sid " +
            "  AND nvl(ufg.customer_sid,:customerSid) = :customerSid " +
            "  JOIN service_user su ON su.sid = ufg.service_user_sid " +
            "  JOIN feature_group fg ON fg.sid = ufg.feature_group_sid " +
            "  JOIN feature_assignment fa ON fa.feature_group_sid = fg.sid " +
            "  JOIN feature f ON f.sid = fa.feature_sid " +
            "  AND f.name LIKE 'fileUpload_dataType_%' " +
            "  JOIN data_type dt ON concat('fileUpload_dataType_', dt.type) = f.name " +
            "  JOIN configuration cfg ON cfg.name = dt.type " +
            "  AND cfg.service_name = 'parserService' " +
            "  AND nvl(" +
            "    cfg.reporting_partner_sid, rp.sid" +
            "  )= rp.sid " +
            "  AND nvl(cfg.customer_sid,:customerSid) = :customerSid " +
            "  JOIN file_type ft ON (" +
            "    ft.type = cfg.configuration_type " +
            "    OR (" +
            "      concat(ft.type, '2') = cfg.configuration_type " +
            "      AND ft.type LIKE 'edi%'" +
            "    )" +
            "  ) " +
            "  JOIN RP_CSR_OVERLAY_V rcov ON rcov.ip_sid = rp.inow_profile_sid " +
            "  AND rcov.CUSTOMER_SID = :customerSid " +
            "WHERE " +
            "  gs.customer_sid = :customerSid " +
            "  AND su.login = :login " +
            "GROUP BY " +
            "  rp.id, " +
            "  rcov.entity_name, " +
            "  rp.create_date," +
            "  rp.update_date," +
            "  rp.inow_profile_sid," +
            "  rp.sid," +
            "  dt.type, " +
            "  ft.type";

    @BeforeAll
    public void getExpectedData() throws Exception
    {
        expected = ReadResource(testDataPath);
        expectedList = List.of((expected.substring(1, expected.length() - 1)).split(","));
    }

    private static boolean checkSubListstring(List<String> mainList, List<String> subList)
    {
        return (mainList.containsAll(subList));
    }

    private String ReadResource(String s) throws Exception
    {
        JsonParser parser = new JsonParser();
        Object obj = parser.parse(new FileReader(s));
        JsonObject jsonObject = (JsonObject) obj;
        Object type = jsonObject.get("key");
        String roles = type.toString();
        return roles;
    }

    private List<String> LoadEntitlements(String url, String token) throws IOException, org.apache.hc.core5.http.ParseException
    {
        CloseableHttpClient client = HttpClientBuilder.create().build();
        HttpPost post = new HttpPost(url);
        ArrayList<BasicNameValuePair> parameters = new ArrayList<BasicNameValuePair>();
        parameters.add(new BasicNameValuePair("grant_type", "urn:ietf:params:oauth:grant-type:uma-ticket"));
        parameters.add(new BasicNameValuePair("client_id", "ChannelNetwork"));
        parameters.add(new BasicNameValuePair("audience", "ChannelNetwork"));
        post.addHeader("Authorization", token);
        post.addHeader("Content-Type", "application/x-www-form-urlencoded");
        parameters.add(new BasicNameValuePair("client_secret", getEnvironment().getProperty("cthKeySecret")));
        post.setEntity(new UrlEncodedFormEntity(parameters));
        HttpResponse response = client.execute(post);
        HttpEntity entity = ((CloseableHttpResponse) response).getEntity();
        String body = EntityUtils.toString(entity, "UTF-8");
        JSONObject obj = new JSONObject(body);
        String access_token = obj.getString("access_token");
        String[] tokenParts = access_token.split("\\.");
        Base64.Decoder decoder = Base64.getUrlDecoder();
        String payLoad = new String(decoder.decode(tokenParts[1]));
        JsonParser parser = new JsonParser();
        Object object = parser.parse(payLoad);
        jsonObject = (JsonObject) object;
        System.out.println(jsonObject);
        JsonObject a = jsonObject.getAsJsonObject("authorization");
        JsonArray jsonArray = a.getAsJsonArray("permissions");
        List<String> rsNamesList = new ArrayList<>();
        for (int i = 0; i < jsonArray.size(); i++)
        {
            JsonElement jsonElement = jsonArray.get(i);
            JsonObject names = jsonElement.getAsJsonObject();
            rsNamesList.add(names.get("rsname").toString());
        }
        return rsNamesList;
    }

    @Test
    public void MfrKeyCloakUserTest() throws Exception
    {
        token = generateCTHManufacturerToken();
        url = getEnvironment().getProperty("cthKeyCloakUrl");
        List<String> decodedToken = LoadEntitlements(url, token);
        Assert.assertTrue("token expected here",decodedToken.size() > 0);
        boolean isSubArray = checkSubListstring(decodedToken, expectedList);
        Assert.assertTrue("Expected keycloak source and received keycloak source are different", isSubArray);
        checkDataTypeandFileType();
        Assert.assertEquals(nucleusUsername,"\"cthmanufacturer\"");
    }

    @Test
    public void InowBaseNotKeyCloakUserTest() throws Exception
    {
        token = generateInowDataOwnerBaseToken();
        System.out.println(token);
        url = getEnvironment().getProperty("inowKeyCloakUrl");
        List<String> decodedToken = LoadEntitlements(url, token);
        System.out.println(decodedToken);
        Assert.assertTrue("token expected here",decodedToken.size() > 0);
        boolean isSubArray = checkSubListstring(decodedToken, expectedList);
        Assert.assertFalse("Expected keycloak source and received keycloak source are different", isSubArray);
        Assert.assertTrue(jsonObject.get("nucleusUsername")==null);
    }

    @Test
    public void CTHPartnerNotKeyCloakUserTest() throws Exception
    {
        token = generateCTHPartnerToken();
        System.out.println(token);
        url = getEnvironment().getProperty("cthKeyCloakUrl");
        List<String> decodedToken = LoadEntitlements(url, token);
        System.out.println(decodedToken);
        Assert.assertTrue("token expected here",decodedToken.size() > 0);
        boolean isSubArray = checkSubListstring(decodedToken, expectedList);
        Assert.assertFalse("Expected keycloak source and received keycloak source are different", isSubArray);
        Assert.assertEquals(jsonObject.get("nucleusUsername").toString(),"\"cthbase\"");
    }

    public void checkDataTypeandFileType() throws InterruptedException
    {
        nucleusUsername = jsonObject.get("nucleusUsername").toString();
        Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("customerSid", 2);
        paramMap.put("login", "cthmanufacturer");
        List data = queryForList(sql, List.class,paramMap);
        List<String> dataType = new ArrayList<>();
        List<String> fileType = new ArrayList<>();
        for(int i=0;i<data.size();i++)
        {
            String ds = data.get(i).toString();
            String json = ds.substring(1, ds.length() - 1);
            JsonParser parser = new JsonParser();
            Object obj = parser.parse(json);
            JsonObject jsonObject = (JsonObject) obj;
            Object dataType1 = jsonObject.get("dataType");
            String dt = dataType1.toString();
            dataType.add(dt);
            Object fileType1 = jsonObject.get("fileType");
            String ft = fileType1.toString();
            fileType.add(ft);
        }
        System.out.println(dataType);
        System.out.println(fileType);

        boolean flag = true;
        for(int i=0;i<fileType.size();i++){
            if(fileType.get(i) != "csv" || fileType.get(i) != "excel" || fileType.get(i) != "json" || fileType.get(i) != "csv" ){
                continue;
            }
            else {
                flag = false;
                break;
            }
        }

        Assert.assertTrue(flag);
    }
}
add_filter('pcp_post_excerpt_limit', function($length) {
    return 15; // Change this number to the desired excerpt length (in words)
}, 999);
#include <bits/stdc++.h>

using namespace std;
const int N = 100;
int dp[N];
vector<vector<int>>combinations[N];

void findCombinations(int amount,vector<int>&coins,vector<int>currentCombination)
{
    if(amount==0)
    {
        combinations[amount].push_back(currentCombination);
        return;
    }
    for(int coin:coins)
    {
        if(amount-coin>=0)
        {
            currentCombination.push_back(coin);
            findCombinations(amount-coin,coins,currentCombination);
            currentCombination.pop_back();
        }
    }
}
void print_combinations(int amount)
{
    if(combinations[amount].empty())
    {
        cout<<"No combinations found"<<endl;
        return;
    }
    cout<<"Combinations:"<< endl;
    for(vector<int>combination:combinations[amount])
    {
        for(int i=0;i<combination.size();i++)
        {
            cout << combination[i];
            if(i<combination.size() - 1)
                cout<< " + ";
        }
        cout<<endl;
    }
}
int func(int amount, vector<int>&coins)
{
    if(amount==0)
        return 0;
    int ans = INT_MAX;
    if(dp[amount]!=-1)
        return dp[amount];
    for(int coin : coins)
    {
        if((amount - coin) >= 0)
        {
            ans = min(ans+0LL, func(amount-coin,coins)+1LL);
        }
    }
    return dp[amount]=ans;
}
int choose_coin(vector<int>&coins, int amount)
{
    //memset(dp,-1,sizeof(dp));
    int ans = func(amount,coins);
    return ans == INT_MAX?-1:ans;
}

int main()
{
    //memset(dp,-1,sizeof(dp));
    vector<int>coins={2,3,4,5,6,9,15};
    cout<<"Minimum coin = "<<choose_coin(coins,23);
    findCombinations(23,coins,{});
    print_combinations(23);
    //for(int i=0;i<sizeof(dp);i++)
    //{
    //    cout<<dp[i]<<" ";
    //}
    return 0;
}





import { LightningElement, track,api, wire } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
import fetchDetailVerification from '@salesforce/apex/BGEAuthenticatedConsumerController.fetchDetailVerification';
import searchFilterList from '@salesforce/apex/BGEAuthenticatedConsumerController.searchFilterList';
import updateCaseWithContact from '@salesforce/apex/BGEAuthenticatedConsumerController.updateCaseWithContact';
import { refreshApex } from '@salesforce/apex';
import bgeFullAccessMessage  from '@salesforce/label/c.bgeFullAccessMessage';
import dynamicMeteringChange from '@salesforce/apex/BGEAuthenticatedConsumerController.dynamicMeteringChange';
import dynamicPaymentChangeMethod from '@salesforce/apex/BGEAuthenticatedConsumerController.dynamicPaymentChangeMethod';


const chatVoiceColumns = [
  {
    label: "Source",
    fieldName: "Source",
    type: "text",
    cellAttributes: {
      iconName: { fieldName: "iconName" },
      iconPosition: "left"
    }
  },
  {
    label: "Name",
    fieldName: "Id",
    type: "url",
    typeAttributes: {
      label: {
        fieldName: "Name",
        type: "text"
      }
    }
  },
  { label: "Email", fieldName: "Email", type: "text" },
  { label: "Home Phone", fieldName: "Phone", type: "text" },
  { label: "Account Id", fieldName: "AccountId", type: "text" }
];

const recordLevelActions = [
    { label : 'Edit', name:'editContact'},
    { label : 'Change Email', name:'changeEmail'},
];

const contactColumns = [ 
    {label: 'Contact Name', fieldName: 'ContactId', type: 'url',
    typeAttributes: {
        label: {
            fieldName: 'Name', type: 'text'
            }
        },
        cellAttributes:{  class: { fieldName : 'highlightRow'}}
    },
    {label: 'Email', fieldName: 'Email', type: 'text',cellAttributes:{  class: { fieldName : 'highlightRow'}} },
    {label: 'Home Phone', fieldName: 'Phone', type: 'text',cellAttributes:{  class: { fieldName : 'highlightRow'}}},
    {label: 'Primary', fieldName: 'isPrimary', type: 'boolean', cellAttributes:{  class: { fieldName : 'highlightRow'}}},
    {label: 'IsDeceased', fieldName: 'IsDeceased', type: 'boolean', cellAttributes:{  class: { fieldName : 'highlightRow'}}},
    {label: 'Status', fieldName: 'ContactStatus', type: 'text', cellAttributes:{  class: { fieldName : 'highlightRow'}}},
    {label: 'Access Level',fieldName: '', 
     cellAttributes:{ 
         style:  { fieldName: 'iconClass' },
         class: { fieldName : 'highlightRow'},
         iconName: { fieldName: 'displayIconName'},
         iconPosition: 'left',
         iconAlternativeText:'test'
     },fieldName:'status'
    },
     {label: 'Update Contact', 
        type: 'action',
        typeAttributes: { 
            rowActions: recordLevelActions
        },
        cellAttributes:{
            class: { fieldName : 'highlightRow'}
        }
    }
];
    
const assetColumns = [
        {label: 'Customer Account', fieldName: 'consumerAccountURL', type: 'url',
        typeAttributes: {
            label: {
                fieldName: 'consumerAccountName', type: 'text'
                }
            },
        },
        {label: 'Billing Account', fieldName: 'billingAccountURL', type: 'url',
        typeAttributes: {
            label: {
                fieldName: 'billingAccountName', type: 'text'
                }
            },
        },
        {label: 'Billing Account Number', fieldName: 'billingAccountNumber', type: 'text'},
        {label: 'Fuel Type', fieldName: 'AssetSubtype__c', type: 'text'},
];

const filterContactColumns = [
  {
    label: "Consumer Account",
    fieldName: "consumerAccountId",
    type: "url",
    typeAttributes: {
      label: {
        fieldName: "consumerAccountName"
      }
    }
  },
  { label: "Billing Account", fieldName: "billingAccountName", type: "text" },
  {
    label: "Contact",
    fieldName: "contactId",
    type: "url",
    typeAttributes: {
      label: {
        fieldName: "contactName"
      }
    }
  },
  { label: "Phone", fieldName: "contactPhone", type: "text" },
  { label: "Email", fieldName: "contactEmail", type: "text" },
  { label: "Primary", fieldName: "contactPrimary", type: "boolean" },
  { label: "Access Level", fieldName: "contactAccessLevel", type: "text" }
];

const altBillNameColumns = [
    {label: "Account name", fieldName: "AccountPage", type: "url",
        typeAttributes: {
            label: {
                fieldName: 'AccountName', type: 'text'
            },
        } 
    },
    {label: "Alternative name", fieldName: "Id", type: "url",
        typeAttributes: {
            label: {
                fieldName: 'AlternativeBillingName__c', type: 'text'
            },
        }
    },
]; 

const filterType = [
    {label : 'Contact Name', value: 'ContactName'},
    {label : 'Account Id', value: 'AccountId'},
    {label : 'Contact Phone', value: 'ContactPhone'},
    {label : 'Contact Email', value: 'ContactEmail'},
    {label : 'Postal Code', value: 'PostalCode'},
    {label : 'Premise Address', value: 'PremiseAddress'}
];

export default class BgeAuthenticatedConsumer extends NavigationMixin(LightningElement) {
    label = {
        bgeFullAccessMessage,
    }

    chatVoiceColumns =  chatVoiceColumns;
    contactColumns = contactColumns;
    assetColumns = assetColumns;
    filterType = filterType;
    filterContactColumns = filterContactColumns;
    recordLevelActions = recordLevelActions;
    altBillNameColumns = altBillNameColumns;
    
    @track paymentMethod;
    @track paymentFrequency;
    @track paymentDetails;

    @track brandJs;
    @track salesOriginJs;
    @track gasSupplyStartDateJs;
    @track gasWithdrawalDateJs;
    @track elecSupplyStartDateJs;
    @track elecWithdrawalDateJs;

    @api recordId;
    boolIsLoading = true;
    boolIsModalOpen=false;
    boolContact = false;
    boolAsset = false;
    boolIsloggedin = false;
    boolLoggedIn = false;
    boolIsSearchContact = false;
    boolIsEnterSearchValue = true;
    boolIsContactUpdate = false;
    boolIsUpdateEmail = false;
    boolIsFullAccess = false;
    boolCheckAnyFlag = false;
  
    strSelectedFilterValue = 'ContactName';
    strSearchText;
    strError;
    strConsumerAccount;
    strVisitorSubject;
    strIDVStatus;
    strClassName;
    strConsumerId;
    strSelectedContactId;
    strDefaultValue;
    strContactURL = '/lightning/r/Contact/';
    strMarketingConsent = 'Marketing consent - ';
    strBillingAccountId;
    strContactPrefs = "Communication preference - ";
    strCommsPrefFormat = "Communications format - ";
    strAltBillAddress = "Alternative billing address - ";
    strBillingAccountBrand;
    strSmartMeterRefusal;
    strSmartMeterRefusalURL;
    strTariffName;
    strTariffElectric = 'Electric - ';
    strTariffGas = 'Gas - ';
    strTariffElectricURL;
    strTariffGasURL;
    strTariffRenewalURL;    
    strTariffRenewal = 'Tariff renewal';
    strTariffElectricStartDate = 'Tariff Start Date: ';
    strTariffElectricEndDate = 'Tariff End Date: ';
    strTariffGasStartDate = 'Tariff Start Date: ';
    strTariffGasEndDate = 'Tariff End Date: ';
    
    @track lstWireData
    @track lstVisitorContactDetail;
    @track selectedContactRow;
    @track lstVisitorDetail;
    @track lstContact;
    @track lstAssets;
    @track lstFilterContact;
    @track lstTotalContactRecords;
    @track lstActiveSessions = [];
    @track lstPremises;

    @track selectedBillingAccount;
    @track latestQuoteRecord;
    
    @track mapFlags = [];
    @track mapOfBillingAccount = new Map();

    selectedAssets = false;
    tempRecords = false;

    dynamicMeteringDisplay(accountid) {
        dynamicMeteringChange({strRecordId:accountid})
        .then((result) => {
            this.brandJs = result.salesBrandCls;
            this.salesOriginJs = result.salesOriginCls;
            this.gasSupplyStartDateJs = result.gasSupplyStartDateCls;
            this.gasWithdrawalDateJs = result.gasWithdrawalDateCls;
            this.elecSupplyStartDateJs = result.elecSupplyStartDateCls;
            this.elecWithdrawalDateJs = result.elecWithdrawalDateCls;
        })
        .catch(error => {
            this.strError = error;
            console.error(this.strError);
        });
    }

    dynamicPaymentInfoDisplay(accountid) {
        dynamicPaymentChangeMethod({strRecordId:accountid})
        .then((result) => {
            this.paymentMethod = result.paymentMethod;
             this.paymentFrequency = result.paymentFrequency;
        })
        .catch(error => {
            this.strError = error;
            console.error(this.strError);
        });
    }

    @wire(fetchDetailVerification, { strRecordId: '$recordId' })
    fetchDetailVerification(wireResult) {
        const { data, error } = wireResult;
        this.lstWireData= wireResult;
        if (data) {
            this.lstVisitorContactDetail = JSON.parse(JSON.stringify(data));
            if(this.lstVisitorContactDetail.consumerAccount){
                this.strConsumerAccount = this.lstVisitorContactDetail.consumerAccount.Name;
                this.strConsumerId = this.lstVisitorContactDetail.consumerAccount.Id;
                this.strConsumerURL = '/lightning/r/Account/'+this.lstVisitorContactDetail.consumerAccount.Id+'/view';
                if(this.lstVisitorContactDetail.consumerAccount.PasswordForHomeVisit__c){
                    this.boolHomeVisitPassword = true;
                }    
            }

            let visitorDetail = {};
            visitorDetail.Source = 'Provided by Web Customer';
            visitorDetail.Name = visitorDetail.Email = visitorDetail.Phone = visitorDetail.AccountId = visitorDetail.Subject = '';
            visitorDetail.iconName = 'standard:contact';

            let caseContactDetail = {};
            caseContactDetail.Source = 'Case Contact';
            caseContactDetail.Name = caseContactDetail.Email = caseContactDetail.Phone = caseContactDetail.AccountId = caseContactDetail.Subject = '';
            caseContactDetail.iconName = 'standard:live_chat_visitor';

            if(this.lstVisitorContactDetail.lstConversationRecords && !this.lstVisitorContactDetail.boolCTLCase){
                for (let i = 0; i <  this.lstVisitorContactDetail.lstConversationRecords.length; i++) {
                    let row =  this.lstVisitorContactDetail.lstConversationRecords[i];
                    if (row){
                        if(row.CustomDetailContextKey === 'First Name' || row.CustomDetailContextKey === 'Last Name'){
                            visitorDetail.Name += row.CustomDetailContextValue!=undefined ? (row.CustomDetailContextValue+' ') : '';
                            visitorDetail.Id = '/';
                        }
                        if(row.CustomDetailContextKey === 'Email'){
                            visitorDetail.Email = row.CustomDetailContextValue;
                        }
                        if(row.CustomDetailContextKey === 'Phone'){
                            visitorDetail.Phone = row.CustomDetailContextValue;
                        }
                        if(row.CustomDetailContextKey === 'Account Number'){
                            visitorDetail.AccountId = row.CustomDetailContextValue;
                        }
                        if(row.CustomDetailContextKey === 'Subject'){
                            this.strVisitorSubject = row.CustomDetailContextValue!=undefined? 'Subject :'+row.CustomDetailContextValue : '';
                        }
                        if(row.CustomDetailContextKey === 'Logged In'){
                            this.boolLoggedIn = row.CustomDetailContextValue;
                        }
                    } 
                }
                this.strIDVStatus = this.boolLoggedIn == 'true' ? 'Logged In' : (this.lstVisitorContactDetail.caseContact != undefined ? 'Please Verify!' : 'Please Identify!' );
                this.strClassName = this.boolLoggedIn == 'true' ? 'greenIcon  slds-button_icon-border' : (this.lstVisitorContactDetail.caseContact != undefined ? 'orangeIcon  slds-button_icon-border' : 'redIcon  slds-button_icon-border' );
            } 
            else if(this.lstVisitorContactDetail.caseCTIDetail && this.lstVisitorContactDetail.boolCTLCase){
                visitorDetail.Source = this.lstVisitorContactDetail.caseCTIDetail.Origin!= undefined ? (this.lstVisitorContactDetail.caseCTIDetail.Origin == 'WhatsApp' ? 'Provided by WhatsApp Customer' : 'Provided by Phone Customer') : 'Provided by Phone Customer' ;
                visitorDetail.Name = this.lstVisitorContactDetail.caseCTIDetail.connectCTISuggestedAccount__c!=undefined ? this.lstVisitorContactDetail.caseCTIDetail.connectCTISuggestedAccount__r.Name : '' ;
                visitorDetail.Id = '';
                visitorDetail.Email = this.lstVisitorContactDetail.caseCTIDetail.Email!= undefined ? this.lstVisitorContactDetail.caseCTIDetail.Email : '';
                visitorDetail.Phone = this.lstVisitorContactDetail.caseCTIDetail.ConnectCTISearchedPhone__c != undefined ? (this.lstVisitorContactDetail.caseCTIDetail.ConnectCTISearchedPhone__c.length >10 ? '0'+this.lstVisitorContactDetail.caseCTIDetail.ConnectCTISearchedPhone__c.slice(this.lstVisitorContactDetail.caseCTIDetail.ConnectCTISearchedPhone__c.length-10): this.lstVisitorContactDetail.caseCTIDetail.ConnectCTISearchedPhone__c):'';
                visitorDetail.AccountId = this.lstVisitorContactDetail.caseCTIDetail.ConnectCTISearchedAccount__c!=undefined ? 'A'+this.lstVisitorContactDetail.caseCTIDetail.ConnectCTISearchedAccount__c : '';
                this.strIDVStatus = this.lstVisitorContactDetail.caseCTIDetail.ConnectCTIIDVStatus__c!=undefined ? (this.lstVisitorContactDetail.caseCTIDetail.ConnectCTIIDVStatus__c.toLowerCase() == 'full' ? 'Logged In' : (this.lstVisitorContactDetail.caseCTIDetail.ConnectCTIIDVStatus__c.toLowerCase() == 'partial' ? 'Please Verify!' : 'Please Identify!' )):'Please Identify!';
                this.strClassName = this.lstVisitorContactDetail.caseCTIDetail.ConnectCTIIDVStatus__c!=undefined ? (this.lstVisitorContactDetail.caseCTIDetail.ConnectCTIIDVStatus__c.toLowerCase() == 'full' ? 'greenIcon  slds-button_icon-border' : (this.lstVisitorContactDetail.caseCTIDetail.ConnectCTIIDVStatus__c.toLowerCase() == 'partial' ? 'orangeIcon  slds-button_icon-border' : 'redIcon  slds-button_icon-border' )):'redIcon  slds-button_icon-border';
            }
            if(this.lstVisitorContactDetail.caseContact) {
                caseContactDetail.Name = this.lstVisitorContactDetail.caseContact.Name!= undefined ? this.lstVisitorContactDetail.caseContact.Name : '';
                caseContactDetail.Id = this.lstVisitorContactDetail.caseContact.Id!= undefined ? '/lightning/r/Contact/'+this.lstVisitorContactDetail.caseContact.Id+'/view' : '';
                caseContactDetail.Email = this.lstVisitorContactDetail.caseContact.Email!= undefined ? this.lstVisitorContactDetail.caseContact.Email : '';
                caseContactDetail.Phone = (this.lstVisitorContactDetail.caseContact.HomePhone!= undefined? this.lstVisitorContactDetail.caseContact.HomePhone:'');
                //caseContactDetail.AccountId = this.lstVisitorContactDetail.strBillingAccount;
                
                /*-----#36965-----*/
                caseContactDetail.AccountName = this.lstVisitorContactDetail.caseContact.Account.Name!= undefined ? this.lstVisitorContactDetail.caseContact.Account.Name : ' ';
                caseContactDetail.AlternativeBillingName__c = this.lstVisitorContactDetail.caseContact.AlternativeBillingName__c!= undefined ? this.lstVisitorContactDetail.caseContact.AlternativeBillingName__c : ' ';
                caseContactDetail.AccountPage = '/lightning/r/Account/'+this.lstVisitorContactDetail.consumerAccount.Id+'/view';
                
                this.caseContact = this.lstVisitorContactDetail.caseContact;
                this.strContactPrefs += this.caseContact.ContactPreferences__c!= undefined? this.caseContact.ContactPreferences__c:'';
                this.strCommsPrefFormat += this.caseContact.PreferredCommunicationFormat__c!= undefined? this.caseContact.PreferredCommunicationFormat__c:'';
                this.strContactURL += this.caseContact.Id+'/view';
                this.strAltBillAddress += [this.caseContact.MailingFlatNumber__c, this.caseContact.MailingHouseNumber__c, this.caseContact.MailingHouseName__c, this.caseContact.MailingStreet__c, this.caseContact.MailingStreet2__c, this.caseContact.MailingDoubleDependentLocality__c, this.caseContact.MailingDependentLocality__c, this.caseContact.MailingLocality__c, this.caseContact.MailingCounty__c, this.caseContact.MailingPostalCode__c].filter(Boolean).join(", ");
                if(this.lstVisitorContactDetail.caseContact.IsDeceased__c){
                    this.mapFlags.push({value:'standard:network_contract', key:'Bereavement'});
                    this.boolCheckAnyFlag = this.mapFlags.length > 0 ? true : false;
                } 

                if(this.lstVisitorContactDetail.consumerAccount.Cases){  
                    this.mapFlags.push({value:'standard:incident', key:'Complaint'});
                    this.boolCheckAnyFlag = this.mapFlags.length > 0 ? true : false;
                } 
            }
            this.lstVisitorDetail = [caseContactDetail,visitorDetail];

            this.communicationsDetail = [caseContactDetail];

            if(this.lstVisitorContactDetail.caseContact && this.lstVisitorContactDetail.caseContact.Individual && this.lstVisitorContactDetail.caseContact.Individual.HasOptedOutSolicit){
                this.strMarketingConsent += 'Opt Out';
            }else if(this.lstVisitorContactDetail.lstContactPointTypeConsent.length > 0 && this.lstVisitorContactDetail.lstContactPointTypeConsent.length < 5){
                this.optInNames = JSON.stringify(this.lstVisitorContactDetail.lstContactPointTypeConsent.map(({ Name }) => Name));
                this.strMarketingConsent += this.optInNames.replaceAll('"', '').replaceAll('[','').replaceAll(']','');
            }else if(this.lstVisitorContactDetail.lstContactPointTypeConsent.length === 5){
                this.strMarketingConsent += 'Opt In';
            }
           
            if(this.lstVisitorContactDetail.lstContact){
                let rowsContact = this.lstVisitorContactDetail.lstContact;
                let lstContact=[];
                for (let i = 0; i < rowsContact.length; i++) {
                    let row = rowsContact[i];
                    if (row){
                        row.Name = row.Name!=undefined?row.Name:'';
                        row.ContactId = row.Id!=undefined?'/lightning/r/Contact/'+row.Id+'/view':'';
                        row.Email = row.Email!=undefined?row.Email:'';
                        row.Phone = row.HomePhone!=undefined?row.HomePhone:'';
                        row.Birthdate = row.Birthdate!=undefined?row.Birthdate:'';
                        row.isPrimary = row.PrimaryContact__c!=undefined?row.PrimaryContact__c:false;
                        row.ContactStatus= row.vlocity_cmt__Status__c!=undefined?row.vlocity_cmt__Status__c:'';
                        row.iconClass = row.AccessLevel__c =='A01'? '--slds-c-icon-color-background:green;':(row.AccessLevel__c == 'A20' ? '--slds-c-icon-color-background:orange':'--slds-c-icon-color-background:grey') ;
                        row.status = row.AccessLevel__c =='A01'? 'Full Access':(row.AccessLevel__c == 'A20' ? 'Enquiry Only':'No Status') ;
                        row.displayIconName='standard:note';
                        row.highlightRow = this.lstVisitorContactDetail.caseContact!= undefined ? (row.Id == this.lstVisitorContactDetail.caseContact.Id ? 'slds-theme_warning':''):'';
                        row.IsDeceased = row.IsDeceased__c!=undefined?row.IsDeceased__c:'';
                        lstContact.push(row);
                    } 
                }
                this.lstContact =lstContact;
                this.boolContact = lstContact.length>0?true:false;
            }

            if(this.lstVisitorContactDetail.lstBillingAccounts){
                let options = [];
                for (var billingAccount of this.lstVisitorContactDetail.lstBillingAccounts) { 
                    caseContactDetail.AccountId += (billingAccount.CustomerReferenceNumber__c!=undefined?billingAccount.CustomerReferenceNumber__c:'')+',';
                    if(billingAccount.vlocity_cmt__PremisesId__c){
                        options.push({ 
                            label: (billingAccount.vlocity_cmt__PremisesId__r.Name + 
                            ' (' + (billingAccount.CustomerReferenceNumber__c!=undefined?billingAccount.CustomerReferenceNumber__c:'') 
                            + ' - ' + (billingAccount.vlocity_cmt__Status__c!=undefined?billingAccount.vlocity_cmt__Status__c:'') + ')'
                            + ', ' + (billingAccount.FuelType__c!=undefined?billingAccount.FuelType__c:'')), 
                            value: billingAccount.Id  
                        });
                    }
                    this.mapOfBillingAccount.set(billingAccount.Id, billingAccount);
                }
                this.lstPremises = options;
                if(this.lstPremises.length === 1){
                    this.strBillingAccountId = this.lstPremises[0].value;
                    this.boolOnePremies = true;
                    this.showHideFlagsIcon();
                    this.filterMetering();
                    this.filterTariff();
                    this.dynamicMeteringDisplay(this.strBillingAccountId);
                    this.dynamicPaymentInfoDisplay(this.strBillingAccountId);
                }
                if(this.lstPremises.length === 0){
                    this.boolNoPremies = true;
            }
            }
        } 
        this.boolIsLoading=false;
    }

    openSearchContact() {
        // to open modal set isModalOpen tarck value as true
        this.boolIsModalOpen = true;
        this.boolIsSearchContact=true;
    }

    closeModal() {
        // to close modal set isModalOpen tarck value as false
        this.boolIsModalOpen = false;
        this.boolIsSearchContact = false;
        this.boolIsContactUpdate = false;
        this.boolIsUpdateEmail = false;
        this.boolIsFullAccess=false;
        this.strSearchText='';
        this.strSelectedContactId=undefined;
        this.strSearchPlaceHolder='';
        this.lstFilterContact=undefined;
        this.lstTotalContactRecords=undefined;
        this.strSelectedFilterValue = 'ContactName';
        this.strDefaultValue='';
    }

    handleRowSelection = event => {
        let selectedRows=event.detail.selectedRows;
        this.selectedContactRow  = selectedRows[0];
        this.strSelectedContactId = this.selectedContactRow.Id;
    }

    handleSearchInputChange(event){
        this.strSearchText = event.target.value;
        if(this.strSearchText.length>3){
            this.boolIsEnterSearchValue = false;
        } else {
            this.boolIsEnterSearchValue = true;
        }
    }

    handleSearch() {
        this.boolIsLoading = true;
        this.lstTotalContactRecords=[];
        searchFilterList({ strSearchObject : this.strSelectedFilterValue, strSearchValue : this.strSearchText}) 
            .then((result) => {
                this.boolFilter = JSON.parse(JSON.stringify(result)).length>0?true:false;
                this.lstTotalContactRecords = JSON.parse(JSON.stringify(result));
        })
        .catch(error => {
            this.strError = error;
            console.error(this.strError);
        });
        this.boolIsLoading = false;
    }

    updateContactHandler(event){
        this.lstFilterContact=[...event.detail.records];
    }

    handleChangeType(event){
        this.strSelectedFilterValue = event.target.value;
    }

    handleUpdateCaseWithContact(){
        this.boolIsLoading = true;
        updateCaseWithContact({ strRecordId : this.recordId, strContactId : this.selectedContactRow.Id })
        .then((result) => {
            this.boolIsLoading = false;
            refreshApex( this.lstWireData);
            eval("$A.get('e.force:refreshView').fire();");
            this.closeModal();
        })
        .catch(error => {
            this.boolIsLoading = false;
            this.strError = error.body.message;
        });
    }


    handleSuccess(){
        this.boolIsLoading=false;
        refreshApex( this.lstWireData);
        this.closeModal();
    }
    
    handleError(event){
        this.boolIsLoading=false;
        console.error(event.detail);
    }

    handleRowAction(event) {
        const actionName = event.detail.action.name;
        const row = event.detail.row;
        this.strDefaultValue=row.AccessLevel__c;
        if(actionName == 'editContact'){
            this.boolIsFullAccess = (row.AccessLevel__c == 'A01' && row.PrimaryContact__c == false  ? true : false);
            this.boolIsModalOpen = true;
            this.boolIsContactUpdate = true;
            this.strSelectedContactId=row.Id;
        }
        else if (actionName == 'changeEmail'){     
            this.boolIsFullAccess = row.AccessLevel__c == 'A01' ? true : false;     
            this.boolIsModalOpen = true;
            this.boolIsUpdateEmail = true;
            this.strSelectedContactId=row.Id;

        }
    }

    handleSecondaryContact() {
        this.boolIsModalOpen = true;
        this.boolIsContactUpdate = true;
        this.boolIsFullAccess=false;
        this.strSelectedContactId='';
        this.strDefaultValue = 'A20'; 
    }

    handleLoading(){
        let isValid = [...this.template.querySelectorAll('lightning-input-field')].reduce( (val, inp) => {
        }, true);
      
      if(isValid) {
        this.boolIsLoading=true;
        }
        
    }

    copyToClipBoard() {
        const container = this.template.querySelector(".container");
        const range = document.createRange();
        range.selectNode(container);
        const selection = window.getSelection();
        selection.removeAllRanges();
        selection.addRange(range);    
        document.execCommand('copy');     
    }

    changeFullAccess(){
        this.template.querySelectorAll('lightning-input-field').forEach(element => {           
            if(element.fieldName == 'AccessLevel__c'){
                this.boolIsFullAccess = element.value == 'A01' ?  true : false;
            } 
        });
    }

    handleChangePremieses(event){
        this.strBillingAccountId = event.target.value;
        this.showHideFlagsIcon();
        this.filterMetering();
        this.filterTariff();
        this.dynamicMeteringDisplay(this.strBillingAccountId);
        this.dynamicPaymentInfoDisplay(this.strBillingAccountId);
    }

    showHideFlagsIcon(){
        var billingAccount = this.mapOfBillingAccount.get(this.strBillingAccountId);
        let checkPSR = JSON.parse(JSON.stringify(this.mapFlags)).find(map=>map.key==='PSR');
        let checkDebt = JSON.parse(JSON.stringify(this.mapFlags)).find(map=>map.key==='Debt');
        if(billingAccount && billingAccount.Debt_Status__c ){
            if(this.mapFlags.length==0 ||(this.mapFlags.length>0 && !checkDebt )){
                this.mapFlags.push({value:'standard:currency', key:'Debt'});
            }
        } else if(checkDebt && checkDebt.key === 'Debt'){
            this.mapFlags = JSON.parse(JSON.stringify(this.mapFlags)).filter(map=>map.key !=='Debt');
        }
        if(billingAccount && billingAccount.PriorityServicesRegister__r && billingAccount.PriorityServicesRegister__r.length >0 ){
            if(this.mapFlags.length==0 ||(this.mapFlags.length>0 && !checkPSR)){
                this.mapFlags.push({value:'standard:partners', key:'PSR'}); 
            } 
        } else if(checkPSR && checkPSR.key == 'PSR'){
            this.mapFlags = JSON.parse(JSON.stringify(this.mapFlags)).filter(map=>map.key !=='PSR');
        }
        this.boolCheckAnyFlag = this.mapFlags.length > 0 ? true : false;

    }

    filterMetering(){
        this.selectedBillingAccount = this.mapOfBillingAccount.get(this.strBillingAccountId);
        //  this.strBillingAccountBrand = this.selectedBillingAccount.vlocity_cmt__PremisesId__r.Name + ', Brand - ' + this.selectedBillingAccount.Brand__c;
        this.strSmartMeterRefusal = this.selectedBillingAccount.SmartRefuserFlag__c != undefined ? 'Smart Refusal - ' + this.selectedBillingAccount.SmartRefuserFlag__c : '';
        this.strSmartMeterRefusalURL = '/lightning/r/Account/'+this.strBillingAccountId+'/view';
        let tempRecords = this.selectedBillingAccount.vlocity_cmt__BillingAccountAssets__r!=undefined ? JSON.parse( JSON.stringify( this.selectedBillingAccount.vlocity_cmt__BillingAccountAssets__r) ): undefined;

        /*  if(tempRecords){        
            tempRecords = tempRecords.map( row => {
                    return {...row, consumerAccountName: row.vlocity_cmt__BillingAccountId__r.Parent.Name,
                    consumerAccountURL : '/lightning/r/Account/'+ row.vlocity_cmt__BillingAccountId__r.ParentId + '/view',
                    billingAccountName : row.vlocity_cmt__BillingAccountId__r.Name,
                    billingAccountURL : '/lightning/r/Account/'+ row.vlocity_cmt__BillingAccountId__c + '/view',
                   billingAccountNumber : row.vlocity_cmt__BillingAccountId__r.CustomerReferenceNumber__c };
            })
        } */
        this.selectedAssets = tempRecords;
    }

    filterTariff(){
        this.selectedBillingAccount = this.mapOfBillingAccount.get(this.strBillingAccountId);
        this.latestQuoteRecord = this.selectedBillingAccount.vlocity_cmt__BillingAccountQuotes__r!=undefined ? this.selectedBillingAccount.vlocity_cmt__BillingAccountQuotes__r[0]:undefined;

        if(this.latestQuoteRecord){
            if( this.latestQuoteRecord.ElectricityUnitPrice__c !== undefined ){
                this.strTariffName = this.latestQuoteRecord.Tariff__c;
                this.strTariffElectric = 'Electric';
                this.strTariffElectricURL = '/lightning/r/Quote/'+this.latestQuoteRecord.Id+'/view';
                this.strTariffElectricStartDate = 'Tariff Start Date: ';
                this.strTariffElectricEndDate = this.latestQuoteRecord.CurrentTariffEndDate__c != undefined ? 'Tariff End Date: ' + this.latestQuoteRecord.CurrentTariffEndDate__c : 'Tariff End Date: ';
            } 
            if (this.latestQuoteRecord.GasUnitPrice__c !== undefined ){
                this.strTariffName = this.latestQuoteRecord.Tariff__c;
                this.strTariffGas = 'Gas';
                this.strTariffGasURL = '/lightning/r/Quote/'+this.latestQuoteRecord.Id+'/view';
                this.strTariffGasStartDate = 'Tariff Start Date: ';
                this.strTariffGasEndDate = this.latestQuoteRecord.CurrentTariffEndDate__c != undefined ? 'Tariff End Date: ' + this.latestQuoteRecord.CurrentTariffEndDate__c : 'Tariff End Date: ';
            }
            this.strTariffRenewalURL = '/lightning/r/Account/'+this.strBillingAccountId+'/related/Opportunities__r/view';
        }
    }

    handleMeterSelection(event) {
            if(event.detail.openSections == 'SmartConsent'){
            this[NavigationMixin.Navigate]({
                type: 'standard__recordPage',
                attributes: {
                    recordId: this.strBillingAccountId,
                    objectApiName: 'Account',
                    actionName: 'view'
                },
            });
        }
    }     

    handleTariffSelection(event) {
        /*
        if(event.detail.openSections == 'TariffElectric' || event.detail.openSections == 'TariffGas' ){
                this[NavigationMixin.Navigate]({
                type: 'standard__recordPage',
                attributes: {
                    recordId: this.latestQuoteRecord.Id,
                    objectApiName: 'Quote',
                    actionName: 'view'
                },
            });
        } else 
        */ 
        if(event.detail.openSections == 'TariffRenewal'){
            this[NavigationMixin.Navigate]({
                type: 'standard__recordRelationshipPage',
                attributes: {
                    recordId: this.strBillingAccountId,
                    relationshipApiName: 'Opportunities__r',
                    objectApiName: 'Account',
                    actionName: 'view'
                },
            });
        }
    }
    /* PSR Flag Buttons*/
    PsrButton() {
        const scrollingElement = (document.scrollingElement || document.body);
        scrollingElement.scrollTo({
            top: scrollingElement.scrollHeight,
            behavior: 'smooth'
        })
    }
 
    DebtButton() {
        const scrollingElement = (document.scrollingElement || document.body);
        scrollingElement.scrollTo({
            top: scrollingElement.scrollHeight,
            behavior: 'smooth'
        })
    }

}
<!--*********************************************************
 * @LWC         : bgeAuthenticatedConsumer
 * @Author      : Bhavdip Gadhiya
 * @Description : This LWC is used to display all information at one place so Agent can verify the consumer.
 *************************************************************-->

 <template>

    <!--***************************** Loading spinner *****************************-->
    <template if:true={boolIsLoading}>
        <div class="slds-p-around_x-large">
            <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        </div>
    </template>

    <template if:true={lstVisitorDetail}>
        <lightning-layout multiple-rows="true">
            <!--***************************** Visitor(Chat Transcript) detail *****************************-->
            <lightning-layout-item padding="around-small" size="12">
                <div class="slds-grid">
                    <h3 class="slds-text-heading_small slds-col slds-p-around_small brandColor"><b>ID & V</b></h3>
                </div>
                <div class="slds-box">
                    <div class="slds-clearfix slds-grid">
                        <div class="slds-page-header slds-page-header__row slds-page-header__col-title">
                            <div class="slds-media ">
                                <div class="slds-media__figure">
                                    <lightning-icon icon-name="utility:user" size="small" class={strClassName}>
                                    </lightning-icon>
                                </div>
                                <div class="slds-media__body ">
                                    <div class="slds-page-header__name ">
                                        <div class="slds-page-header__name-title">
                                            <h1 class="brandColor">
                                                <span class="slds-page-header__title slds-truncate"
                                                    title={strConsumerAccount}>
                                                    <a href={strConsumerURL}>{strConsumerAccount}
                                                        ({strIDVStatus})</a></span>
                                            </h1>
                                        </div>
                                    </div>
                                    <p class="slds-page-header__name-meta">{strVisitorSubject}</p>
                                </div>
                            </div>
                        </div>
                        <div class="slds-float_right">
                            <lightning-button label="Search Contact Name" variant="brand" icon-name="utility:search"
                                class="slds-m-top_x-large slds-button_brand" onclick={openSearchContact}></lightning-button>
                        </div>
                    </div>
                    <lightning-datatable columns={chatVoiceColumns} data={lstVisitorDetail} key-field="id"
                        enable-infinite-loading hide-checkbox-column="false"
                        class="skyblueHeader slds-size_9-of-12 slds-table_bordered slds-table_col-bordered slds-table_striped">
                    </lightning-datatable>
                    <template if:false={lstVisitorDetail}>
                        <div class="slds-text-align_center">No Record Found</div>
                    </template>
                </div>
            </lightning-layout-item>
            <!--***************************** Visitor(Chat Transcript) detail *****************************-->

            <!--*********************************Available Properties*****************************-->
            <lightning-layout-item size="6" class="slds-p-around_medium">
                <h3 class="slds-text-heading_small slds-p-around_medium slds-col brandColor"><b>Available Properties</b></h3>
                <div class="slds-box">
                    <template if:true={boolNoPremies}>
                            There is no any property.
                    </template>
                    <template if:false={boolNoPremies}>
                        <template if:false={boolOnePremies}>
                            <template if:true={lstPremises}>
                                <lightning-radio-group options={lstPremises} onchange={handleChangePremieses} value={strBillingAccountId} type="radio">
                                </lightning-radio-group>
                            </template>
                        </template>
                        <template if:true={boolOnePremies}>
                            <lightning-radio-group options={lstPremises} onchange={handleChangePremieses} value={strBillingAccountId} type="radio" disabled={boolOnePremies}>
                            </lightning-radio-group>
                        </template>
                    </template>
                </div>
            </lightning-layout-item>
            <!--*********************************Available Properties*****************************-->

            <!--*********************************Available Flags*****************************-->
            <lightning-layout-item size="6" class="slds-p-around_medium">
                <h3 class="slds-text-heading_small slds-col slds-p-around_medium brandColor"><b>Flags</b></h3>
                <div class="slds-box">
                    <template if:true={boolCheckAnyFlag}>  
 
                         <!--Debt Flag-->
                          <button style="border:0px solid; background-color: transparent;" onclick={DebtButton} class="debtButton">
                                <lightning-icon icon-name="standard:currency" alternative-text="Debt Icon" size="large"></lightning-icon>
                            </button>
                           
                        <!--PSR Flag-->
                            <button style="border:0px solid; background-color: transparent;" onclick={PsrButton} class="psrButton">
                                <lightning-icon icon-name="standard:partners" alternative-text="PSR Icon" size="large"></lightning-icon>
                            </button>

                        
                        <!--Bereavement Flag-->
                        <lightning-helptext content = "Bereavement - go to related tab"></lightning-helptext>
                        <lightning-icon icon-name="standard:network_contract" alternative-text="Bereavement Icon" size="large" onmouseover={showText} onmouseout={hideText}></lightning-icon>
 
                        <!--Complaint Flag-->
                        <lightning-helptext content = "Open Complaint - go to related tab"></lightning-helptext>
                        <lightning-icon icon-name="standard:incident" alternative-text="Complaint Icon" size="large"></lightning-icon>

                    </template>
                
                    <template if:false={boolCheckAnyFlag}>
                        There is no flag.
                    </template>
                </div>
            </lightning-layout-item>
            <!--*********************************Available Flags*****************************-->
            <!--*********************************Metering & Tariff*****************************-->
            <lightning-layout-item  size="6" class="slds-p-around_medium"> <!--Metering Header-->
                <h3 class="slds-text-heading_small slds-col brandColor slds-p-around_medium"><b>Metering</b></h3>
                <div class="slds-box">
                    <template if:true={selectedAssets}>
                        <p><lightning-formatted-url value={strSmartMeterRefusalURL} label={strSmartMeterRefusal} target="_parent"></lightning-formatted-url></p>
                            <div class="slds-grid slds-gutters"> 
                                <div class="slds-col slds-size_12-of-12">
                                    <span> <strong> Brand - </strong> </span>
                                    <span> {brandJs} </span>  
                                </div>
                            </div>
                            <div class="slds-grid slds-gutters"> 
                                <div class="slds-col slds-size_12-of-12">
                                    <span> <strong> Sales Origin - </strong> </span>
                                    <span> {salesOriginJs} </span>  
                                </div>
                            </div>
                            <div class="slds-grid slds-gutters"> 
                                <div class="slds-col slds-size_12-of-12">
                                    <span> <strong> Gas Supply Start date - </strong>   </span>
                                    <span> {gasSupplyStartDateJs} </span>  
                                </div>                                
                            </div>
                            <div class="slds-grid slds-gutters"> 
                                <div class="slds-col slds-size_12-of-12">
                                    <span> <strong> Gas Withdrawal date - </strong>   </span>
                                    <span> {gasWithdrawalDateJs} </span>  
                                </div>
                            </div>
                            <div class="slds-grid slds-gutters"> 
                                <div class="slds-col slds-size_12-of-12">
                                    <span> <strong> Electricity Supply Start date - </strong>   </span>
                                    <span> {elecSupplyStartDateJs} </span>  
                                </div>                          
                            </div>
                            <div class="slds-grid slds-gutters"> 
                                <div class="slds-col slds-size_12-of-12">
                                    <span> <strong> Electricity Withdrawal date - </strong>   </span>
                                    <span> {elecWithdrawalDateJs} </span>  
                                </div>
                            </div>
                            <div class="slds-grid slds-gutters"> 
                                <div class="slds-col slds-size_12-of-12">
                                    <span> <strong> Password for home visit - </strong>   </span>
                                    <span> 
                                        <template if:true={boolHomeVisitPassword}>
                                            <lightning-icon icon-name="utility:check" alternative-text="check" title="true" size="xx-small"></lightning-icon>
                                        </template>
                                        <template if:false={boolHomeVisitPassword}>
                                            <lightning-icon icon-name="utility:close" alternative-text="close" title="false" size="xx-small"></lightning-icon>
                                        </template>
                                    </span>  
                                </div>
                            </div>
                    </template> 
            <!--    <template if:true={selectedAssets}> 
                        <lightning-accordion allow-multiple-sections-open>
                            <lightning-accordion-section class="slds-text-align_left" name="A" label={strBillingAccountBrand}> 
                                <lightning-datatable columns={assetColumns} data={selectedAssets} key-field="id"
                                    enable-infinite-loading hide-checkbox-column="false"
                                    class="skyblueHeader slds-table_bordered slds-table_col-bordered slds-table_striped"
                                    ></lightning-datatable>
                            </lightning-accordion-section>
                        </lightning-accordion> -->
            <!--    </template> -->
                    <template if:false={selectedAssets}>
                        There is no Metering record.
                    </template>
                </div>
            </lightning-layout-item>
            <lightning-layout-item  size="6" class="slds-p-around_medium" > <!--Tariff Header-->
                <h3 class="slds-text-heading_small slds-col  brandColor slds-p-around_medium"><b>Tariff</b></h3>
                <div class="slds-box">
                    <template if:true={latestQuoteRecord}>
                        <lightning-accordion allow-multiple-sections-open>
                            <lightning-accordion-section class="slds-text-align_left" name="TariffName" label={strTariffName}> 
                                <ul>
                                    <li> 
                                        <lightning-formatted-url value={strTariffElectricURL} label={strTariffElectric} target="_parent"></lightning-formatted-url>
                                        <ul class="slds-list_dotted">
                                            <li>{strTariffElectricStartDate}</li>
                                            <li>{strTariffElectricEndDate}</li>
                                        </ul>
                                    </li>    
                                </ul>
                                <ul>
                                    <li> 
                                        <lightning-formatted-url value={strTariffGasURL} label={strTariffGas} target="_parent"></lightning-formatted-url>
                                        <ul class="slds-list_dotted">
                                            <li>{strTariffGasStartDate}</li>
                                            <li>{strTariffGasEndDate}</li>
                                        </ul>
                                    </li>    
                                </ul>
                            </lightning-accordion-section>                     
                        </lightning-accordion>
                        <p><lightning-formatted-url value={strTariffRenewalURL} label={strTariffRenewal} target="_parent"></lightning-formatted-url></p>
                    </template>
                     <template if:false={latestQuoteRecord}>
                        There is no Tariff record.
                     </template>
                </div>
            </lightning-layout-item>
            <!--*********************************Metering & Tariff*****************************-->

             <!--***************************** Communication preferences & Payment *****************************-->
             <lightning-layout-item size="6" class="slds-p-around_medium" >
                <h3 class="slds-text-heading_small slds-col slds-p-around_small brandColor"><b>Communications</b></h3>
                <div class="slds-box ">
                    <template if:true={communicationsDetail}>
                        <div class="slds-clearfix slds-grid">
                            <div class="slds-page-header slds-page-header__col-title" >
                                
                                <lightning-accordion allow-multiple-sections-open class = "slds-accordion_communications">
                                    <lightning-accordion-section  label="Alternative billing name ">
                                        <lightning-datatable
                                            key-field="id"
                                            columns={altBillNameColumns}
                                            data={communicationsDetail}
                                            hide-checkbox-column
                                            class="skyblueHeader slds-size_9-of-12 slds-table_bordered slds-table_col-bordered slds-table_striped">
                                        </lightning-datatable>    
                                    </lightning-accordion-section>
                                </lightning-accordion>
                                <p><lightning-formatted-url value={strContactURL} label={strAltBillAddress} target="_self"></lightning-formatted-url></p>
                                <p><lightning-formatted-url value={strContactURL} label={strMarketingConsent} target="_self"></lightning-formatted-url></p>
                                <p><lightning-formatted-url value={strContactURL} label={strContactPrefs} target="_self"></lightning-formatted-url></p>
                                <p><lightning-formatted-url value={strContactURL} label={strCommsPrefFormat} target="_self"></lightning-formatted-url></p>
                            </div>
                        </div>
                    </template>
                </div>
            </lightning-layout-item>
            <lightning-layout-item  size="6" class="slds-p-around_medium" > <!--Payment Header-->
                <h3 class="slds-text-heading_small slds-col  brandColor slds-p-around_medium"><b>Payment</b></h3>
                <template if:true={paymentFrequency}>
                    <template if:true={paymentMethod}>
                        <div class="slds-box">
                            <div class="slds-grid slds-gutters"> 
                                <div class="slds-col slds-size_12-of-12">
                                    <span> <strong> Payment Frequency - </strong> </span>
                                    <span> {paymentFrequency} </span>  
                                </div>
                            </div>
                            <div class="slds-grid slds-gutters"> 
                                <div class="slds-col slds-size_12-of-12">
                                    <span> <strong> Payment Method - </strong>   </span>
                                    <span> {paymentMethod} </span>  
                                </div>
                            </div>
                        </div>
                    </template>
                </template>
                <template if:false={paymentFrequency}>
                     <template if:false={paymentMethod}>
                        <div class="slds-box">
                            <div> There is no Payment data. </div>
                        </div>
                     </template>
                </template>
            </lightning-layout-item>
            <!--***************************** Communication preferences & Payment *****************************-->

            <!--***************************** Contacts (Associated with consumer account) detail *****************************-->
            <lightning-layout-item  size="12" class="slds-p-around_medium" >
                <!-- <h3 class="slds-text-heading_small slds-col slds-p-around_medium brandColor"><b>Data Related with Parent
                        Consumer Account: <a href={strConsumerURL}>{strConsumerAccount}</a></b></h3> -->
                <h3 class="slds-text-heading_small slds-col  brandColor slds-p-around_medium"><b>Related Contacts</b></h3>
                <div class="slds-box ">
                    <template if:true={boolContact}>
                        <div class="slds-clearfix ">
                            <div class="slds-float_right slds-p-bottom_medium">
                                <lightning-button label="Add Secondary Contact" variant="brand"  onclick={handleSecondaryContact} class="slds-button_brand" ></lightning-button>
                            </div>
                        </div>
                        <lightning-datatable columns={contactColumns} data={lstContact} key-field="id"
                            enable-infinite-loading hide-checkbox-column="false"
                            class="skyblueHeader slds-table_bordered slds-table_col-bordered slds-table_striped"
                            onrowaction={handleRowAction}></lightning-datatable>
                    </template>
                    <template if:false={boolContact}>
                        <div class="slds-text-align_center slds-p-top_medium">This information is only available when
                            Case.Contact is populated</div>
                    </template>
                </div>
            </lightning-layout-item>
            <!--***************************** Contacts (Associated with consumer account) detail *****************************-->

            <!--***************************** Modal Search Contacts *****************************-->
            <lightning-layout-item padding="around-small" size="12">
                <template if:true={boolIsModalOpen}>
                    <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true"
                        aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
                        <div class="slds-modal__container">
                            <header class="slds-modal__header">
                                <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
                                    title="Close" onclick={closeModal}>
                                    <lightning-icon icon-name="utility:close" alternative-text="close" variant="inverse"
                                        size="small"></lightning-icon>
                                    <span class="slds-assistive-text">Close</span>
                                </button>
                                <template if:true={boolIsFullAccess}>
                                    <div class="slds-grid slds-box">
                                        <div class="container">
                                            {label.bgeFullAccessMessage} &nbsp;  
                                            <a href="https://mcas-proxyweb.mcas.ms/certificate-checker?login=false&originalUrl=https%3A%2F%2Fwww.britishgas.co.uk.mcas.ms%2Fidentity%2F%3FMcasTsid%3D26110&McasCSRF=5009e5f155e099eb7d5fd20d6fa8a5467c0c1e158dbdf40804e70aac77145190">
                                                Log in to your account (https://www.britishgas.co.uk/identity/)</a>
                                        </div>
                                        <lightning-button-icon onclick={copyToClipBoard} name="changeEmail"
                                            icon-name="utility:copy" variant="bare" size="large"
                                            class="slds-m-left_xx-small bg-icon">
                                        </lightning-button-icon>
                                    </div><br/>
                                </template>
                                <template if:true={boolIsSearchContact}>
                                    <lightning-card title="Search Contact (Please select and update contact on Case)"
                                        icon-name="action:add_contact"></lightning-card>
                                </template>
                                <template if:true={boolIsContactUpdate}>
                                    <template if:true={strSelectedContactId}>
                                        <lightning-card title="Update Contact" icon-name="action:add_contact">
                                        </lightning-card>
                                    </template>
                                    <template if:false={strSelectedContactId}>
                                        <lightning-card title="Create Contact" icon-name="action:add_contact">
                                        </lightning-card>
                                    </template>
                                </template>
                                <template if:true={boolIsUpdateEmail}>
                                </template>
                            </header>

                            <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
                                <template if:true={boolIsSearchContact}>
                                    <div class="slds-grid slds-align_absolute-center">
                                        <lightning-helptext
                                            content="Please select value for searching and update case with contact">
                                        </lightning-helptext> &nbsp;
                                        <lightning-combobox name="" label="" options={filterType}
                                            value={strSelectedFilterValue} onchange={handleChangeType}
                                            class="slds-size_2-of-12"></lightning-combobox> &nbsp;
                                        <lightning-input type="text" label="" value={strSearchText}
                                            onchange={handleSearchInputChange} class="slds-size_7-of-12">
                                        </lightning-input> &nbsp;
                                        <lightning-button-icon icon-name="utility:search" alternative-text="Search"
                                            title="Search" onclick={handleSearch} label="Search"
                                            class="slds-size_1-of-12 slds-p-top_medium"
                                            disabled={boolIsEnterSearchValue}></lightning-button-icon>
                                    </div> <br /><br /><br />
                                    <template if:true={strError}>
                                        <h1 class="slds-align_absolute-center slds-text-color_error ">System error:
                                            Please contact your system administrator.</h1>
                                    </template>
                                    <template if:true={lstTotalContactRecords} class="slds-box">
                                        <lightning-card title="" icon-name="standard:Contact"
                                            class="slds-p-bottom-medium">
                                            <lightning-datatable columns={filterContactColumns} data={lstFilterContact}
                                                key-field="id" max-row-selection=1 onrowselection={handleRowSelection}
                                                class="slds-table_header-fixed_container slds-scrollable_x slds-border_top slds-table_bordered slds-table_col-bordered slds-table_striped">
                                            </lightning-datatable>
                                        </lightning-card> <br /><br />
                                        <template if:false={boolFilter}>
                                            <h1 class="slds-text-align_center">No Record Found</h1>
                                        </template>
                                        <template if:true={boolFilter}>
                                            <c-bge-common-datatable-pagination records={lstTotalContactRecords}
                                                record-size="6" onupdate={updateContactHandler}>
                                            </c-bge-common-datatable-pagination>
                                        </template>
                                        <br />
                                        <template if:true={selectedContactRow}>
                                            <footer
                                                class="slds-modal__footer slds-align_absolute-center slds-button-group-row">
                                                <lightning-button variant="brand" label="Update" title="Update Case"
                                                    onclick={handleUpdateCaseWithContact}
                                                    class="slds-p-top_medium slds-button-group-item"></lightning-button>
                                                <lightning-button label="Cancel" title="Cancel Case"
                                                    onclick={closeModal}
                                                    class="slds-p-top_medium slds-button-group-item"></lightning-button>
                                            </footer>
                                        </template>
                                    </template>
                                </template>

                                <template if:true={boolIsContactUpdate}>
                                    <lightning-record-edit-form record-id={strSelectedContactId}
                                        object-api-name="Contact" columns="2" onsuccess={handleSuccess}
                                        onerror={handleError} oncancel={closeModal}>
                                        <lightning-messages></lightning-messages>
                                        <lightning-layout multiple-rows>
                                            <lightning-layout-item size="6" padding="around-small">
                                                <lightning-input-field field-name="AccountId" value={strConsumerId}
                                                    required=true></lightning-input-field>
                                            </lightning-layout-item>
                                            <lightning-layout-item size="6" padding="around-small">
                                                <lightning-input-field field-name="AccessLevel__c" required=true onchange={changeFullAccess} data-name="accesslevel" value={strDefaultValue}>
                                                </lightning-input-field>
                                            </lightning-layout-item>
                                            <lightning-layout-item size="6" padding="around-small">
                                                <lightning-input-field field-name="Title"></lightning-input-field>
                                            </lightning-layout-item>
                                            <lightning-layout-item size="6" padding="around-small">
                                                <lightning-input-field field-name="vlocity_cmt__Status__c"
                                                    required=true></lightning-input-field>
                                            </lightning-layout-item>
                                            <lightning-layout-item size="6" padding="around-small">
                                                <lightning-input-field field-name="FirstName"></lightning-input-field>
                                            </lightning-layout-item>
                                            <lightning-layout-item size="6" padding="around-small">
                                                <lightning-input-field field-name="Email"></lightning-input-field>
                                            </lightning-layout-item>
                                            <lightning-layout-item size="6" padding="around-small">
                                                <lightning-input-field field-name="LastName" required=true>
                                                </lightning-input-field>
                                            </lightning-layout-item>
                                            <lightning-layout-item size="6" padding="around-small">
                                                <div class="slds-form__row">
                                                    <div class="slds-form__item" role="listitem">
                                                        <div class="slds-form-element slds-form-element_horizontal  ">
                                                            <label class="slds-form-element__label"
                                                                for="phoneId">Home Phone</label>
                                                            <div class="slds-form-element__control">
                                                                <lightning-input-field id="phoneId" field-name="HomePhone"
                                                                    variant="label-hidden"></lightning-input-field>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </lightning-layout-item>
                                            <lightning-layout-item size="6" padding="around-small">
                                                <lightning-input-field field-name="MobilePhone"></lightning-input-field>
                                            </lightning-layout-item>
                                        </lightning-layout>
                                        <div class="slds-grid slds-align_absolute-center  slds-button-group-row">
                                            <template if:true={strSelectedContactId}>
                                                <lightning-button variant="brand" type="submit" name="Update"
                                                    label="Update" onsuccess={handleSuccess} onerror={handleError}  onclick={handleLoading} 
                                                    oncancel={closeModal} class="slds-button-group-item">
                                                </lightning-button>
                                            </template>
                                            <template if:false={strSelectedContactId}>
                                                <lightning-button variant="brand" type="submit" name="Create"
                                                    label="Create" onsuccess={handleSuccess} onerror={handleError} onclick={handleLoading}
                                                    oncancel={closeModal} class="slds-button-group-item">
                                                </lightning-button>
                                            </template>                                            
                                            <lightning-button label="Cancel"  onclick={closeModal}
                                                class=" slds-button-group-item"></lightning-button>
                                        </div>
                                    </lightning-record-edit-form>
                                </template>

                                <template if:true={boolIsUpdateEmail}>
                                    <c-change-contact-email record-id={strSelectedContactId} onclose={closeModal}
                                        is-customer-360=true></c-change-contact-email>
                                </template>

                                <template if:true={boolIsLoading}>
                                    <div class="slds-p-around_x-large">
                                        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
                                    </div>
                                </template>

                                <template if:true={boolIsContactNew}>
                                </template>
                            </div>
                        </div>
                    </section>
                    <div class="slds-backdrop slds-backdrop_open"></div>
                </template>
            </lightning-layout-item>

            <lightning-layout-item padding="around-small" size="12"></lightning-layout-item>

        </lightning-layout>
    </template>
</template>
type ParseProjects = (arg: {
						  file: File;
					}) => Props['data'][number]['data'][number]['data'][number][];

const parseProjectsDefaultValue: ReturnType<ParseProjects> = [];

export const parseProjects: ParseProjects = ({ file }) => {

	try {
		// ! Projects make project array
		return Object.entries(file.project).reduce((acc, item) => {
			const currentKey = item[0] as PROJECT;
			if (item[1]) {
				const result: ReturnType<ParseProjects>[number] = {
				project: currentKey,
				status: CUSTOMER_STATUS.CONTACTED, 
				label: '',
			};
			
			return [...acc, result];
			
			}
			
		return acc;
			
		}, parseProjectsDefaultValue);
	
	} catch {

	return parseProjectsDefaultValue;

	}

};
type GroupeDataByDate = (arg: { filteredFiles: CustomerFile[] }) => {
	[key: string]: CustomerStatusCardsProps['data'][number]['data'][number][];
};

const groupeDataByDateDefaultValue: ReturnType<GroupeDataByDate> = {};

export const groupeDataByDate: GroupeDataByDate = ({ filteredFiles }) => {
	try {
	// ! Group files by date
	return filteredFiles.reduce((acc, item) => {
		const computedProjects = parseProjects({ file: item });
		const filesByDate = { title: item.customer, data: computedProjects };
		
		if (acc[item.updatedAt]) {
			return { ...acc, [item.updatedAt]: [...acc[item.updatedAt], filesByDate] };
		}
		
		return { ...acc, [item.updatedAt]: [filesByDate] };
		
		}, groupeDataByDateDefaultValue);
	} catch (error) {
	return groupeDataByDateDefaultValue;
	}
};
Array.findIndex((item) => item === indextoFind) return index
import { isArray as isArrayUtils, isObject as isObjectUtils } from '@utils/functions';

import { compareString } from '../compareString';

// ****************************
// ? move to @utils/functions
type MyObject = { [key: string]: unknown };
type IsObject = (data: unknown) => data is MyObject;
export const isObject: IsObject = (data): data is MyObject => isObjectUtils(data);

type Array = unknown[];
type IsArray = (data: unknown) => data is Array;
export const isArray: IsArray = (data): data is Array => isArrayUtils(data);
// ****************************

export type FilterFileByValue = (file: unknown, value: string) => boolean;

export const filterFileByValue: FilterFileByValue = (file, value) => {
	try {
		const fileValues = (isObject(file) && Object.values(file)) || [];
		
		const filteredFileValues = fileValues.filter((fileValue) => {
			if (typeof fileValue === 'string') {
				return compareString({ string1: fileValue, string2: value });
			}

			if (isArray(fileValue)) {
				const values = fileValue.filter((nestedFile) => filterFileByValue(nestedFile, value));
				return !!values.length;
			
			}
		
		return filterFileByValue(fileValue, value);
		
		});
		return !!filteredFileValues.length;
		
	} catch {
		return false;
	}

};
<iframe id="twitch-chat-embed"
        src="https://www.twitch.tv/embed/twitchdev/chat?parent=dev.twitch.tv"
        height="500"
        width="350">
</iframe>
#include <bits/stdc++.h>
using namespace std;

const int N = 10010;
int dp[N];

int func(int amount, vector<int> &coins)
{
    if (amount == 0)
        return 0;
    if (dp[amount] != -1)
        return dp[amount];
    int ans = INT_MAX;
    for (int coin : coins)
    {
        if (amount - coin >= 0)
        {
            ans = min(ans, func(amount - coin, coins) + 1);
        }
    }
    return dp[amount] = ans;
} 

int coinChange(vector<int> &coins, int amount)
{
    int ans = func(amount, coins);
    return ans == INT_MAX ? -1 : ans;
}

int main()
{
    memset(dp, -1, sizeof(dp));
    vector<int> coins = {1, 2, 5};
    cout << coinChange(coins, 11);

    return 0;
}
///////////////////////////////////
#include <bits/stdc++.h>
using namespace std;

const int N = 10010;
int dp[N][N];

int func(int ind, int amount, vector<int> &coins)
{
    if (amount == 0)
        return 1;
    if (ind < 0)
        return 0;
    if (dp[ind][amount] != -1)
        return dp[ind][amount];
    int way = 0;
    for (int coin_amount = 0; coin_amount <= amount; coin_amount += coins[ind])
    {
        way += func(ind - 1, amount - coin_amount, coins);
    }
    return dp[ind][amount] = way;
}

int coinChange(vector<int> &coins, int amount)
{
    memset(dp, -1, sizeof(dp));
    return func(coins.size() - 1, amount, coins);
}

int main()
{
    vector<int> coins = {1, 2, 5};
    cout << coinChange(coins, 5);

    return 0;
}
//////////////////////////
#include <bits/stdc++.h>
using namespace std;
int coin[1000], dp[1000][1000];
int coin_change(int n, int sum, int k)
{
    if (sum < 0)
        return 0;
    if (sum == 0 && k == 0)
        return 1;
    if (n == -1)
        return 0;
    if (dp[n][sum] != -1)
        return dp[n][sum];
    return dp[n][sum] = (coin_change(n - 1, sum - coin[n - 1], k - 1)) || (coin_change(n - 1, sum, k));
}
int main()
{
    int n, k, sum;
    cin >> n >> k >> sum;
    for (int i = 0; i < n; i++)
        cin >> coin[i];
    memset(dp, -1, sizeof(dp));
    coin_change(n, sum, k);
    cout << (dp[n][sum] ? "YES" : "NO");
}
const onChange = (e: React.FormEvent<HTMLInputElement>) => {
  const newValue = e.currentTarget.value;
}
Step-1
sudo apt-get update -y
init 6  //( will restart )//

Step-2 //Install Python//
sudo apt-get install python3-dev python3.11-dev python3-setuptools python3-pip python3-distutils software-properties-common xvfb libfontconfig wkhtmltopdf libmysqlclient-dev -y

Step-3 //Install Virtual Enviroment//
sudo apt-get install python3.11-venv -y
sudo apt install python-is-python3 -y
python3 -V //( result Python 3.11.X )
python -V //(resulat Python 3.11.X )

Step-4 // Install Curl//
curl -sL https://deb.nodesource.com/setup_20.x | bash -

Step-5 // Install NODE & Redis Server//
sudo apt-get install -y nodejs
sudo apt-get install nodejs redis-server -y
sudo apt-get install cron git -y
node --version //( result must be : v20.XXX )

Step-6 // Install NPM & Yarn //
sudo apt-get install npm
sudo npm install -g yarn
npm --version //( result must be : 9.XX.X )
yarn --version

Step-7 //Install Mariadb
sudo apt-get install mariadb-server mariadb-client -y //install the Latest Version//
sudo apt-get install mariadb-server=10.6 mariadb-client=10.6 -y // Version Above 10.8 is not Tested
mariadb --version //( result must be mariadb Ver 15.1 Distrib 10.6.7-MariaDB, )

Step-8 //Set Mariadb security//
sudo mysql_secure_installation

//Enter current password for root (enter for none): Press your [Enter] key, there is no password set by default
//Switch to unix_socket authentication N
//Set root password? [Y/n] Y
//New password:
//Re-enter new password:
//Remove anonymous users? [Y/n] Y
//Disallow root login remotely? [Y/n] N
//Remove test database and access to it? [Y/n] Y
//Reload privilege tables now? [Y/n] Y

//Set Mariadb formats.

Step-9 // Setup the Server//
vim /etc/mysql/mariadb.conf.d/erpnext.cnf //Not Working//
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
//Add in CNF FILE// CTRL+S & CTRL+X//

[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

// Restart SQL//
systemctl restart mariadb

Step-10 // Create User//
//Create a user "erpnext"
//Set password,
//Set usermod,
//Set sudo prvilege.

useradd -m -s /bin/bash erpnext
passwd erpnext
usermod -aG sudo erpnext
su - erpnext

//Now you are inside the new user. Now let us set it's path.
vim ~/.bashrc
//add this line
PATH=$PATH:~/.local/bin/
source ~/.bashrc

su - erpnext
sudo mkdir /opt/bench
sudo chown -R erpnext:erpnext /opt/bench

Step-11 // Install node-sass //
cd /opt/bench
yarn add node-sass
//Check node-sass Version//
yarn --version //( result must be:1.22.19 )
/opt/bench/node_modules/.bin/node-sass -v //Not Working//
//( result must be: node-sass	9.0.1	(Wrapper)	[JavaScript]//

libsass 3.5.5	//(Sass Compiler)	[C/C++] )
npm node-sass -v //(Result must be: 8.19.1 )

Step-12 //Check pip3 version//
pip3 -V //( Result must be pip 23.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) )
pip -V //(Result must be pip 23.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) )

____________________________________________________
//Now we are entering to Frappe installation. Before that finish all the following tests ( in violet letters ) . Otherwise installation will fail
****************************************************
Step-13 //Check App Version//
*****************************
python -V //( result Python 3.11.4 )
node --version //( result must be : v20.17.0 )
npm --version //( result must be : 9.8.1 )
mariadb --version //( result must be mariadb Ver 15.1 Distrib 10.6.7-MariaDB, )
yarn --version //( result must be:1.22.19 )
/opt/bench/node_modules/.bin/node-sass -v 
//( result must be: node-sass	9.0.1	(Wrapper)	[JavaScript] libsass 3.5.5	(Sass Compiler)	[C/C++] )
npm node-sass -v //( Result must be: 9.8.1 )
pip3 --version //( Result must be pip 23.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) )
pip --version //( Result must be pip 23.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) )
redis-server --version //(Redis server v=7.0.16 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=a3fdef44459b3ad6)
wkhtmltopdf -V //( wkhtmltopdf 0.12.6 )
git -v //(git version 2.39.1)
***************************************************
  
Step-14 // Virtual Enviroment Error Managements//
//Once you start using pip , you may get error "This environment is externally managed" in that case, either use following command, or use pipx//

remove file /usr/lib/python3.x/EXTERNALLY-MANAGED, //Not Working//
____________________________________
sudo apt install pipx
pip3 install frappe-bench   //Not Working//
pipx install frappe-bench
//(or pipx install frappe-bench , if you havent removed EXTERNALLY-MANAGED ) 
sudo apt install python3.10-venv //Not Working//
bench init frappe-bench --frappe-branch version-15-beta
_________OR_____________When Above is Not Work______________
//Virtual Enviroment Chat GPT advise//
//Remember, you'll need to activate this virtual environment every time you work on your project.//
python3 -m venv myenv
source myenv/bin/activate
pip install frappe-bench
pip3 install frappe-bench
_____________________________________
cd frappe-bench
sed -i '/web:/ s/$/ --noreload/' Procfile
pip3 install honcho
bench start

//While you are running the above command , you can see below
//* Running on http://127.0.0.1:8000
//14:29:30 web.1      | * Running on http://45.56.78.183:8000 (Press CTRL+C to quit)
//Also, you can telnet to port 8000 to this server from outside.
//telnet v14.erpgulf.com 8000 ( port will show open )

Step-15 //Install New Site//
//Press CTRL+C to return to CLI
bench new-site site1.local

//At this point we have a frappe site running - bench start and you will get the website on port 8000. But ERPNext not yet installed. Let's continue

Step-16 //Install ERPNext Version-15//
bench get-app erpnext --branch version-15-beta
bench get-app payments --branch version-15-beta
bench --site site1.local install-app erpnext 

Step-17 //Install HRMS Version-15//
bench get-app hrms --branch version-15
bench get-app hrms //if Above Not Work//
bench --site site1.local install-app hrms 

Step-18 //Install LENDING / Loan//
bench get-app lending
bench --site site1.local install-app lending

Note:- To Start Bench
source myenv/bin/activate
cd frappe-bench
bench start

//Now you have ERPNext on port 8000. ( http://yourhost.example.com:8000 )
//You can run the setup-wizard on the browser.

var express = require('express');
var router = express.Router();
const multer  = require('multer');
const Teacher = require('../model/teacher_register');
const fs = require('fs')

const storage = multer.diskStorage({
    destination: function (req, file, cb) {
      cb(null, 'uploads/'); // Store uploaded images in the 'uploads' directory
    },
    filename: function (req, file, cb) {
      cb(null, Date.now() + '-' + file.originalname);
    },
  });
  
const upload = multer({ storage: storage });

const TeacherRegister = async (req, res, next) => {
    try {
        
        const teacher = new Teacher({
            tea_fname: req.body.tea_fname,
            tea_lname: req.body.tea_lname,
            tea_email: req.body.tea_email,
            tea_number: req.body.tea_number,
            tea_address: req.body.tea_address,
            tea_subject: req.body.tea_subject,
            tea_image: req.file.filename,
        })

        const teacher_data = await teacher.save();
        let teacher_id = teacher_data._id;

        res.json({
            status: 200,
            message: "Teacher Register Successfully",
            teacher_id: teacher_id,
            destination: "Please Save your Teacher id Becoses login time is required"

        })

    } catch (error) {

    fs.unlinkSync(req.file.path);
    
    res.json({
        status: 400,
        message: "Please Rechake Your Details",
        hint: "Some information is Duplicate"
    })
        
    }
}

router.post("/register",upload.single('tea_image'), TeacherRegister);
*** For laravel versions < 10 put this line
    $app->bind('path.public', function() {
        return __DIR__;
    });
just after this line

    $app = require_once __DIR__.'/../../{applicationname}/bootstrap/app.php';

****For laravel version >= 10 add this line
    $app->usePublicPath(__DIR__);
just after this line

    $app = require_once __DIR__.'/../../{applicationname}/bootstrap/app.php';
const menuItemLinks - document -querySelectorAl1(' .menu-item a');
const menuToggle - document.querySelector (' .bricks-mobile-menu-toggle")
                                                                                    
const handleclick = () => {
    menuToggle.click()
}

if (window.matchMedia(' (max-width: 768px) ').matches) {

      menuItemLinks.forEach(link =› {

          link.addEventListener('click', (event) => {
						handleClick();
          })
      })
}
ERPNEXT AND FRAPPE BENCH & ALL APP INSTALL VERSION

cd frappe-bench
bench version

//Check python version
python -V
python3 -V
python -V //( result Python 3.11.4 )
 
//Check pip or pip3 version
pip --version 
pip3 --version
pip -V
pip3 -V

//Check node version.
node --version 

//check npm version and confirm
npm --version
npm node-sass -v //( Result must be: 9.8.1 )
/opt/bench/node_modules/.bin/node-sass -v 
//( result must be:	(Wrapper)	[JavaScript] libsass 3.5.5	(Sass Compiler)	[C/C++] 

//Yarn Version//
yarn --version //( result must be:1.22.19 )

//MariaDB Version//
mariadb --version //( result must be mariadb Ver 15.1 Distrib 10.6.7-MariaDB, )

// Radis Server//
redis-server --version //(Redis server v=7.0.16 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=a3fdef44459b3ad6)

//PDF Version//
wkhtmltopdf -V //( wkhtmltopdf 0.12.6 )

//Git Version//
git -v //(git version 2.39.1)
//----------//


bench switch-to-branch version-14 frappe erpnext
bench switch-to-branch version-14 frappe erpnext --upgrade
  
  ///---------///
  
//1- Take backup. ( Should I explain that !!! ) 
//2- Make sure you don't have any customization those are not committed.
  
cd /opt/bench/frappe-bench/apps/erpnext
git status
  
//Refresh index: 100% (6953/6953), done.
//On branch version-13
//Your branch is up to date with 'upstream/version-13'.
//nothing to commit, working tree clean

/opt/bench/frappe-bench/apps/frappe
git status
  
//On branch version-13
//Your branch is up to date with 'upstream/version-13'.
//nothing to commit, working tree clean

//3-Check python version
python3 -V 
Python 3.8.10 ( needs to be upgraded to 3.10 )

//4-check node version.
node --version
v12.22.12 ( needs to be upgraded to v16.X )

//5-Check pip or pip3 version
pip3 --version 
//20.2 ( needs to be upgrade to 22.x )


//6- Upgrade python

sudo apt install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.10 python3.10-dev python3.10-distutils
//Confirm python version upgrade by
python3.10 --version
Python 3.10.6

//Make Python 3.10 the default.
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1

//Make sure python command executes python3
sudo apt install python-is-python3


python -V
Python 3.10.6
python3 -V
Python 3.10.6

//7 - Upgrade PIP

curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
pip install html5lib
pip3 install --upgrade pip
sudo apt-get remove python3-apt -y
sudo apt-get install python3-apt -y


//check PIP verison and confirm.
pip --version
pip 22.2.2 from /home/erpnext/.local/lib/python3.10/site-packages/pip (python 3.10)
pip3 --version
pip 22.2.2 from /home/erpnext/.local/lib/python3.10/site-packages/pip (python 3.10)


//8- Upgrade Node
curl -sL https://deb.nodesource.com/setup_16.x | bash -
apt-get install nodejs redis-server -y


//check node version and confirm
node --version
v16.17.0



//9- Upgrade NPM

npm upgrade
sudo npm install 16
sudo npm install -g npm@8.19.1


//check npm version and confirm
npm --version
8.19.1


//10 -Move your old python env folder to env-archive, in-case anything goes wrong, you can return to the original


cd /opt/bench/frappe-bench/
mv env env-archive

//11- Create new virtual env for python-3.10

pip install virtualenv
virtualenv --python python3.10 env
env/bin/pip install -U pip

//12- Change git upstream from V13 to V14

env/bin/pip install -e apps/frappe -e apps/erpnext
pip3 install frappe-bench 

bench switch-to-branch frappe erpnext version-14 ( edited this line. Please see the note 2 ** ) 
//( If the above command don't work, use this one )  bench switch-to-branch version-14 frappe erpnext --upgrade 


//check upstream and make sure upstream repository is V14
cd /opt/bench/frappe-bench/apps/erpnext
git status

//Your branch is up to date with 'upstream/version-14'.


cd /opt/bench/frappe-bench/apps/frappe
git status

//Your branch is up to date with 'upstream/version-14'.


//13- Install and upgrade V14. Please note that monolith is broken on V14 and you must install payments and hrms module in addition to ERPNext


bench get-app payments
bench get-app hrms
bench update --reset
bench --site *sitename* install-app hrms
bench --site *sitename* install-app payments
bench --site v13.erpgulf.com migrate

sudo service supervisor restart
sudo service nginx restart

//That is it. Check whether you ERPNext and Frappe upgrade to V14



---------

Note 1: *
//If you face problem with nginx because of log type error ( log type main not found or something like that ) 

vvim /etc/nginx/nginx.conf and add following on http section.

log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"';


-----------------------
Note:2 **

Note from ( https://discuss.erpnext.com/u/flexy2ky ) 
modify this command in your document:
bench switch-to-branch version-14

//As this command will fail if the site has custom apps installed because the command will try to switch the apps to version-14 as well. so the command should be:

bench switch-to-branch frappe erpnext version-14

//This ensures that the switch-to-branch command only affects frappe and erpnext and ignores any other installed app.
- 👀 I’m interested in ...
echo "# Idealhands0" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/Idealhands0/Idealhands0.git
git push -u origin main
<!DOCTYPE html> <!-- Define que este documento es HTML5 -->
<html> <!-- Elemento raíz de una página HTML -->
<head> <!-- Contiene información meta sobre la página HTML -->
    <title>Mi Primera Página</title> <!-- Titulo en la pestaña de la página) -->
</head>
<body> <!-- Contiene el contenido de la página -->
    <h1>Mi Primer Encabezado</h1> <!-- Un encabezado grande -->
    <p>Mi primer párrafo.</p> <!-- Un párrafo -->
</body>
</html>
#include <iostream>
#include <cmath>
#include <fstream>
using namespace std;

int main()
{
    ifstream fichierIN ("res.txt");
    double salaire1, salaire2, salaire3, temp1;
    string nom1, nom2, nom3;
    int th1, th2, th3;
    int nbheure1, nbheure2, nbheure3;
    //fichierIN >> nom1 >> th1 >> nbheure1
    //          >> nom2 >> th2 >> nbheure2
    //          >> nom3 >> th3 >> nbheure3;
              
    for(int i = 1; i <= 3; i++){      // changer la boucle pour un while(!fichierIN.eof)
        fichierIN >> nom1 >> th1 >> nbheure1;
        
    
        if(nbheure1 > 40){
            temp1 =  (nbheure1 - (nbheure1 % 40)) * th1;
            nbheure1 %= 40;
            temp1 += ((nbheure1 * 1.5) * th1);
        } else {
                temp1 = nbheure1 * th1;
            }
        cout << temp1 << endl;    
    }
    
}

ssh-keygen -R 85.31.239.241  # Remove the old entry
ssh-keyscan 85.31.239.241 >> ~/.ssh/known_hosts  # Add the new entry
star

Thu Sep 21 2023 11:08:27 GMT+0000 (UTC)

@prettyleka

star

Thu Sep 21 2023 10:16:14 GMT+0000 (UTC)

@gaurav752 #html

star

Thu Sep 21 2023 10:10:32 GMT+0000 (UTC) https://www.securitytokenizer.io/whitepaper-writing-services

@madonacathelin

star

Thu Sep 21 2023 07:41:34 GMT+0000 (UTC)

@akaeyad

star

Thu Sep 21 2023 07:32:08 GMT+0000 (UTC)

@ClemensBerteld #python #airflow #dag

star

Thu Sep 21 2023 07:23:43 GMT+0000 (UTC) https://www.udemy.com/course/microservices-with-node-js-and-react/learn/lecture/26393470

@jalalrafiyev

star

Thu Sep 21 2023 06:52:18 GMT+0000 (UTC) https://holypython.com/intermediate-python-exercises/exercise-13-python-map-function/

@vikas180

star

Thu Sep 21 2023 05:52:17 GMT+0000 (UTC)

@viinod07

star

Thu Sep 21 2023 05:49:17 GMT+0000 (UTC)

@Mohammadrezasmz

star

Thu Sep 21 2023 05:48:07 GMT+0000 (UTC)

@viinod07

star

Thu Sep 21 2023 05:42:07 GMT+0000 (UTC)

@Mohammadrezasmz

star

Thu Sep 21 2023 05:35:13 GMT+0000 (UTC)

@Mohammadrezasmz

star

Thu Sep 21 2023 05:32:39 GMT+0000 (UTC)

@Mohammadrezasmz

star

Thu Sep 21 2023 05:19:35 GMT+0000 (UTC)

@Mohammadrezasmz

star

Thu Sep 21 2023 04:54:09 GMT+0000 (UTC)

@Mohammadrezasmz

star

Thu Sep 21 2023 04:40:11 GMT+0000 (UTC)

@Alihaan #php

star

Thu Sep 21 2023 04:30:56 GMT+0000 (UTC)

@Mohammadrezasmz

star

Thu Sep 21 2023 04:14:13 GMT+0000 (UTC)

@sid_balar

star

Wed Sep 20 2023 23:31:31 GMT+0000 (UTC) https://github.com/kura1420/SAKIP

@kura1420

star

Wed Sep 20 2023 13:18:59 GMT+0000 (UTC)

@makkarim07

star

Wed Sep 20 2023 13:18:09 GMT+0000 (UTC)

@makkarim07

star

Wed Sep 20 2023 13:16:57 GMT+0000 (UTC)

@makkarim07

star

Wed Sep 20 2023 13:16:22 GMT+0000 (UTC)

@makkarim07

star

Wed Sep 20 2023 12:34:26 GMT+0000 (UTC) https://stackoverflow.com/questions/35033704/csrf-with-rest-api-laravel

@Zeeshan0811

star

Wed Sep 20 2023 12:04:18 GMT+0000 (UTC)

@thanuj

star

Wed Sep 20 2023 10:39:57 GMT+0000 (UTC) https://www.addustechnologies.com/blog/metamask-wallet-clone-script

@jonathandaveiam #metamaskwallet #cryptowallet #cryptocurrencies

star

Wed Sep 20 2023 10:26:08 GMT+0000 (UTC) http://localhost/prodslidewoo/wp-admin/theme-editor.php?file

@Pulak

star

Wed Sep 20 2023 10:11:38 GMT+0000 (UTC)

@jin_mori

star

Wed Sep 20 2023 09:37:13 GMT+0000 (UTC)

@FloLiman

star

Wed Sep 20 2023 09:36:01 GMT+0000 (UTC)

@FloLiman

star

Wed Sep 20 2023 09:17:12 GMT+0000 (UTC)

@mangouste #typescript

star

Wed Sep 20 2023 09:16:20 GMT+0000 (UTC)

@mangouste #typescript

star

Wed Sep 20 2023 09:15:41 GMT+0000 (UTC)

@mangouste #typescript

star

Wed Sep 20 2023 09:14:47 GMT+0000 (UTC)

@mangouste #typescript

star

Wed Sep 20 2023 08:53:10 GMT+0000 (UTC) https://dev.twitch.tv/docs/embed/chat/

@Love_Code

star

Wed Sep 20 2023 08:30:31 GMT+0000 (UTC) https://www.speqto.com/

@speqtotech #web #development #phoneapp #digitalmarketing

star

Wed Sep 20 2023 08:14:37 GMT+0000 (UTC)

@jin_mori

star

Wed Sep 20 2023 07:41:09 GMT+0000 (UTC) https://stackoverflow.com/questions/40676343/typescript-input-onchange-event-target-value

@Abdulaziz #javascript

star

Wed Sep 20 2023 06:47:14 GMT+0000 (UTC)

@sid_balar

star

Wed Sep 20 2023 06:46:44 GMT+0000 (UTC) https://stackoverflow.com/questions/30198669/how-to-change-public-folder-to-public-html-in-laravel

@Zeeshan0811 #laravel

star

Wed Sep 20 2023 05:15:08 GMT+0000 (UTC)

@Taimoor #terminal

star

Wed Sep 20 2023 04:58:08 GMT+0000 (UTC)

@Taimoor #terminal

star

Wed Sep 20 2023 04:28:48 GMT+0000 (UTC) https://github.com/

@mags

star

Wed Sep 20 2023 04:21:53 GMT+0000 (UTC) https://github.com/Idealhands0/Idealhands0

@mags

star

Wed Sep 20 2023 03:34:49 GMT+0000 (UTC)

@puntocode

star

Tue Sep 19 2023 21:18:59 GMT+0000 (UTC)

@Mehdiiiiiii7

star

Tue Sep 19 2023 20:14:24 GMT+0000 (UTC)

@MuhammadAhmad #spreadoperator

Save snippets that work with our extensions

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