Replace text between curly brackets to div with this text

I have input, and textarea. I use vue to set textarea’s text to what’s in input. I want to be able to write something like {#123123}text{/#} to change text’s color. Right now, i don’t really need any color, i just want to know how to find text between {#} and {/#} and put it div which changes color.

I don’t even know where to start, probably i should use some function to find {, then check text after it, after that find }, but I’m really not sure.

Customize Zoomable icicle using d3

I want to add one image and one text area in each cell of zoomable Icicle.

I have tried something to put textbox and image on cells using cell.append

// Add an image to each cell
const image  = cell.append("image")
   .attr("xlink:href", "/fileV.jpg") // Change the path to your image
   .attr("width", 100)  // Adjust the width of the image
   .attr("height", 100)  // Adjust the height of the image
   .attr("x",20)
   .attr("y",300)
   .classed("img", true);

// Add a text area to each cell
const textarea = cell.append("foreignObject")
   .attr("width", 500)  // Adjust the width of the text area
   .attr("height", 100)  // Adjust the height of the text area
   .attr("x",20)
   .attr("y",1200/2)
   .append("xhtml:textarea")
   .on("blur", function(event, d) {
      // Add your onblur logic here
      console.log("Textarea blur event:", d.data.name, "value", event.target.value);
    });

But the problem is, Other clusters text area and image is showing on current cluster.
Is there anyway cleaner to append elements on icicle svg? also can I show somehow current cluster image and text area?
Here is the repository link for what I have tried since now Repo Link

unable to access VertX evo V1000 and V100 gateway

I’m trying to access VertX EVO V1000 and V100 Gateway for access controlling using JAVASCRIPT but unable to do so.

Please help me out. I’m open to try any kind of solutions to do so but only using JAVASCRIPT.

THANKS IN ADVANCE.

I’ve trying using modbus-serial npm module but only able to connect with the controller IP Address but unable to do any further proceeding.

Empty data getting posted in Mongodb database using Node JS html

How to slove this problem Please help me


const express=require("express");
const app=express();
const bodyparser=require("body-parser");
const cors=require("cors");
const mongoose=require("mongoose");
const PORT=4000;
app.use(cors());
app.use(express.urlencoded({extended:false}));
app.use(express.json());
app.use(bodyparser.urlencoded({extended:true}));

const URL='mongodb+srv://biswadebraj:[email protected]/UserDB';
 const userSchema=new mongoose.Schema({
    name:{
        type:String
    },
    password:{
        type:String
    }
 });
 const UserModel= mongoose.model("userData",userSchema);

app.get("/",(req,res)=>{
    res.send("hello ")
})
app.get("/reg",(req,res)=>{
    res.sendFile(__dirname+ "/./index.html")

})
app.post("/reg",async(req,res)=>{

    const newUser= new UserModel(req.body);
    await newUser.save();
   res.status(201).json({
        meg:"User created",
    })

});
mongoose.connect(URL)
try {
    console.log("Db is conected");
    
} catch (error) {
    console.log("Db is not conected");
    console.log(error);
    process.exit(1);
    
}

app.listen(PORT, ()=>{
    console.log(`Server is running http://localhost:${PORT}`)
});
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <a href="/">Home</a>
    <div class="container">
        <h1>Register From</h1>
        <form action="/reg" method="POST" enctype="multipart/form-data">
            <input type="text" name="name" placeholder="enter your name">
            <input type="password" name="password" placeholder="enter your name">

            <input type="submit" value="Register">
        </form>
    </div>

    
</body>
</html>

============

Input output

=====

how to solve this problem Please help. if you know anyone how to slove please explain .share your code please. I will try to slove this problem around 5days.but i canot slove this problem.

enter image description hereenter image description hereenter image description here

Add extra grid size in React Bootstrap 5

Is it possible to add an extra size to react bootstrap?
Right now the bootstrap sizes are as follows:

      WPW    Container Max-Width
sx < 576px - none
sm > 567px - 540px
md > 768px - 720px
lg > 992px - 960px
xl > 1200px - 1140px
xxl > 1400px - 1320px

I would like to add another one like
xxl > 1580px – 1500px

I want to add this because I want a container with a max width of 1500px and be able to divide columns of the row in such a way as to fit 5 columns on a row.

So far I added this to my CSS

@media (min-width: 1580px) {
  .container,
  .container-lg,
  .container-md,
  .container-sm,
  .container-xl,
  .container-xxl {
    max-width: 1500px;
  }
}

This only makes the container bigger, doesn’t adjust the col sizes and if I use xxl={2} or xxl={2.2} I still get 4 items/row.

Custom Cypress command doesn’t return the expected value

I’m writing the follow custom Cypress command in order to get the value of an element in my html page. The idea is to do this:

MyCompanyAPI.API.Fields.getById('main').value

What ist fast the same as

window.document.getElementById().value

But I need to use the first option and in a Cypress command. So I did something like that:

Cypress.Commands.add('getValue', (id) => {

cy.window().then((win) => {
    const myCompanyAPI = win.MyCompanyAPI;
    if (!hybridForms) {
      cy.log('MyCompanyAPI object not found in window.');
      return cy.wrap(undefined);
    }
  
    return cy.wrap(myCompanyAPI.API.Fields).invoke('getById', id).then((result) => {
      const value = result && result.value;
      cy.log(`Value for ${id}:`, value);
  
      if (value === undefined) {
        cy.log(`API call for ${id} returned undefined.`);
      }
  
      return cy.wrap(value);
    });
  });

});

The win.MyCompanyAPI and myCompanyAPI.API.Fields really exist inside win. But when I try to call the function getByID() inside myCompanyAPI.API.Fields, the result is just:

Command: log
index-a10e15b7.js:103972 Message: API call for #main returned undefined.
index-a10e15b7.js:103972 Args:

I’ve tried in many ways. One of them like that, in order to debbug:

Cypress.Commands.add('getValue', (id) => {

    cy.window().then((win) => {
        const hybridForms = win.HybridForms;
        if (!hybridForms) {
          cy.log('HybridForms object not found in window.');
          return cy.wrap(undefined);
        }
      
        const api = hybridForms.API;
        if (!api) {
          cy.log('API not found in HybridForms.');
          return cy.wrap(undefined);
        }
      
        const fields = api.Fields;
        if (!fields) {
          cy.log('Fields not found in API.');
          return cy.wrap(undefined);
        }
      
        const getById = fields.getById;
        if (!getById) {
          cy.log('getById not found in Fields.');
          return cy.wrap(undefined);
        }
      
        const value = getById(id);
        if (!value) {
          cy.log(`Value for ${id} is undefined.`);
          return cy.wrap(undefined);
        }
      
        const finalValue = value.value;
        cy.log(`Final value for ${id}:`, finalValue);
      
        return cy.wrap(finalValue);
      });
      
      
      
  });

But the result ist also: Value for #main is undefined..

Could anyone here help me in this issue?

Thanks in advance!

I need to receive the value of

MyCompanyAPI.API.Fields.getById('main').value

But inside a Cypress custom command

Paralax gradient + transform css

Can you please tell me how I can make the text colour change when scrolling depending on the background gradient and increase when scrolling?

Right now, either gradient or zoom works.

Added clarity and showed two code examples that work either this way or that way.

$(window).scroll(function() {
  var mass = Math.min(20, 1 + 0.005 * $(this).scrollTop());
  $('div').css('transform', 'scale(' + mass + ')');
});
body {
  height: 200vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

div {
  font-size: 100px;
  text-align: center;
  font-weight: 600;
  background: linear-gradient(to top, blue 20%, red 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-attachment: fixed;
}

span {
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div><span>TEST</span></div>
body {
  height: 200vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

div {
  font-size: 100px;
  text-align: center;
  font-weight: 600;
  background: linear-gradient(to top, blue 20%, red 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-attachment: fixed;
}

span {
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
<div><span>TEST</span></div>

How to mark an input field as changes or edited via javascript?

i have an user-script that inputs data into an html form. (like document.getElementById(‘username’).value = ‘[email protected]’;)

But this form has some fancy check to detect whether the field has been changed. So when i fill the field via javascript is gives an error like ’empty value’ but when i type or paste the same text into the field it works.

So somehow i need to mark the field as ‘changed’ or mimic some actual typing into the field to by pass the check, like fake a back-space to remove the last character.

How can this be done?

Nextjs13 on server side rendering How to call axois post only once when page will be initially load

on the client side, we can use useEffect hook to make sure the function runs only once but I don’t know how to do a similar kind of task on server-side rendering.

here my code:

export default async function page({params}) {
  
  const fetchBlog = ()=>{
  
      axios.get(`http://localhost:8000/single-blog/${params.slug}`).then((res)=>{
        
         console.log(res)
      }).catch((err)=>{
        if(err.message == "Network Error"){
               alert("our server temporary  down")
        }
         
        
      })
    ;

    
   
  }
    
  fetchBlog()
 



  return (
    <>
    <BlogDetails params={params}/>
    </>
  )
}
 

Also want to know how to use Axois with credentials true on the server side. I tried this on the server side but withCredentials:true not working on server side but same code working on client side

 axios.get(`http://localhost:8000/single-blog/${params.slug}`,{withCredentials:true})

Sending an excel file to teams bot in a channel

I have made a teams bot using botbuilder SDK 4.0, there is a feature in the bot where the user uploads a file to the bot and the bot collects the download_url and send it to the backend for the file to be downloaded and processed,this is all working fine until i added the to a channel.

I can send and receive messages from the bot without any problems but the file upload is not working the file can be uploaded in the channel but the bot does not receive the response and the ‘context.activity.attachment.length’ is 0, indicating that the bot has not received the attachment.

const url = context.activity.attachments[0].content.downloadUrl;

This is the code i use to get the download url after checking if the attachment.length is greater than 0.

Would appreciate any help in getting the download url for the file uploaded in the teams bot framework.

How to use “cookies-next” in axios interceptors config on nextjs

i spent a lot of time on this, how can i use getCookie() and setCookie() of cookie-next in axios interceptors
it doesn’t work, I console.log token and RefreshToken it has that, but setToken() still doesn’t work, here is my code:

import axios from "axios";
import { getCookie, setCookie } from "cookies-next";

const axiosUser = axios.create({
  baseURL: process.env.NEXT_PUBLIC_BASE_URL_USER,
  headers: { "Content-Type": "application/json" },
  withCredentials: true,
});

const axiosLogin = axios.create({
  baseURL: process.env.NEXT_PUBLIC_BASE_URL_USER,
  headers: { "Content-Type": "application/json" },
  withCredentials: true,
});

axiosUser.interceptors.request.use(
  async (config) => {
    const token = getCookie("TOKEN");

    console.log("««««« token »»»»»", token);

    return config;
  },
  (error) => {
    return Promise.reject(error);
  },
);

axiosLogin.interceptors.response.use(
  async (response) => {
    const { token, refreshToken } = response.data;

    if (token) {
      setCookie("TOKEN", token);
      console.log("««««« token »»»»»", token);
    }
    if (refreshToken) {
      setCookie("REFRESHTOKEN", refreshToken);
      console.log("««««« refreshToken »»»»»", refreshToken);
    }
    return response;
  },
  (error) => {
    return Promise.reject(error);
  },
);

export { axiosUser, axiosLogin };

I searched a lot but to no avail

JiraXray RestAPI login with Playwright

I am new to Playwright , I need to extract sessionId in JiraXray RestAPI ,
but I am getting 403/401 , Basic credentials is not reaching request , can someone help me on Playwright Request for Basic Auth

curl -H “Accept: application/json” -u jira_username:jira_password https://jiraserver.example.com/rest/raven/1.0/api/test/CALC-1880/step

playwright.config.j

httpCredentials: {
               username: "username",
               password: "pwd123"
           },

test.spec.js

const context = await browser.newContext({
                    httpCredentials: {username: 'username', password: 'pwd123'}
                });
    
                let sessionid= await context.request.get('https://jiraserver.example.com/rest/auth/1/session');
            expect(sessionid).toBeTruthy();

getting 403 , username password is not passed
In works fine in Cypress as below

cy.request({
method: ‘GET’,
form: true,
url: ‘https://jiraserver.example.com/rest/auth/1/session’,
auth: {
username: ‘username’,
password: ‘pwd123’,
},
headers: {
‘content-type’: ‘application/json’,
}

jquery jqxgrid word wrap

$('#tGrid').jqxGrid(
    {
        theme: "ui-redmond",
        width: '100%',
        autoheight: true,
        source: dataAdapter,
        showfilterrow: true,
        filterable: true,
        selectionmode: 'multiplecellsextended',
        autorowheight: true,
        columns:
            [{ text: 'Detail', datafield: 'Detail', columntype: 'textbox', sortable: true, filtertype: 'input', width: '45%', cellsrenderer: function (row, column, value, defaultHtml, columnSettings, record)
             {
                        return '<br><div style="word-wrap: break-word;">' + value +'</div><br>';
             }
            }]
    });

I want the whole text inside details to be visible on the grid, but instead, it is shown as below:
enter image description here

How do I fix this?