I can’t add the method by using addEventListner in Angular Project

getCheckStatus(checkStatus: string) {
    let statusClass = '';
    if (checkStatus === 'Completed') {
      statusClass = 'mat-focus-indicator btn--primary__button mat-raised-button mat-button-base';
    } else {
      statusClass = 'mat-focus-indicator mat-raised-button mat-button-base mat-button-disabled';
    }
    const button = document.createElement('button');
    button.className = statusClass;
    button.textContent = 'Close';
    button.addEventListener("click", () => this.popUp());
    const container = document.createElement('div');
    container.appendChild(button);    
    return container.innerHTML;
  }
popUp() {console.log('Finally this is working');}

I’m trying to call this method by adding addEventListner in my Angular Project. But this is not working, this popUp() method is never called.

MyAssumption: this is a JavaScript code, but we have to write in typescript in Angular, but I can’t find any different syntax especially for typescript.

Javascript function to identify duplicates and ignore duplicates only in a certain thing

This below js code checks for duplicate aliases in html code given in textarea and if the alias is repeated it shows duplicate alias found error I want to ignore and don’t show duplicate error only in this case

`<!--[if mso]>
    <a href="https://www.w3schools.com" alias="test">Visit W3Schools</a> 
<![endif]-->
`
`<a href="https://www.w3schools.com" alias="test">Visit W3Schools</a>
`
It should not display duplicate alias only if it is in 
`<!--[if mso]>
    
<![endif]-->
`

Js code

    const checkAliasInNode = (node) => {
      const alias = node.getAttribute("alias");
      const href = node.getAttribute("href");
      if (href === null) {
    // Handle the case where href is null (or undefined) separately
    console.error("Href attribute is null or undefined for the following node:", node);
    return;
  }
      if (alias === null || alias.trim() === "") {
        missingAliases.push(`<span style="color: red;">Missing alias for link with href = "${href}" </span>`);
      } else if (!/^[a-zA-Z0-9_]+$/.test(alias) || alias.endsWith("-")) {
        invalidAliases.push(`<span style="color: #FF641C;">Invalid alias "${alias}" for link with href = "${href}" </span>`);
      } else if (aliases.has(alias)) {
        duplicateAliases.push(`<span style="color: #FF641C;">Duplicate alias "${alias}" found for link with href = "${href}" </span>`);
      } else {
        aliases.add(alias);
      }
     };

It should not display duplicate alias only in mso it can be excused

Why dotenv not able to load environment variables?

I have the following directory structure: enter image description here

I am using dotenv to load environment variables but its not loading them.It gives undefined even though I have defined them in the .env file.

The code in index.js is here:

enter image description here

I’ve even tried the following for requiring:

require('dotenv').config();

require('dotenv').config({path:'C:UsersxuiosDesktopAirlineManagementProjectFlightsAndSearchsrc.env'}); // absolute path

require('dotenv').config({path:'FlightsAndSearchsrc.env'}); //relative path

However it still doesnt load the env variables defined as :enter image description here

How to launch IntelliJ IDEA

How to run IntelliJ IDEA using .exe or .the bat file either .py.
I tried to run using .bat a c .exe hasn’t figured out how yet.I have windows.
You can also help to run it using some program from github.
If someone can help, please do it.
I also tried to run it through java, but I also failed.java -noverify -Xmx2048M -Djava.library.path=.natives;. -cp .minecraft.jar net.minecraft.client.main.Main --username %Nick% User43 854 --height 480 --version Optifine --gameDir C:Minecraftgame --assetsDir .assets --assetIndex 1.12 --uuid N/A --accessToken 0 --userType mojang

How to pin the top header row showing column names in this bootstrap-vue table?

I have a bootstrap-vue table that looks like this;

enter image description here

Here is the code;

<template>
  <div>
    <b-table hover :items="items"></b-table>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        items: [
          { age: 40, first_name: 'Dickerson', last_name: 'Macdonald' },
          { age: 21, first_name: 'Larsen', last_name: 'Shaw' },
          {
            age: 89,
            first_name: 'Geneva',
            last_name: 'Wilson',
            _rowVariant: 'danger'
          },
          {
            age: 40,
            first_name: 'Thor',
            last_name: 'MacDonald',
            _cellVariants: { age: 'info', first_name: 'warning' }
          },
          { age: 29, first_name: 'Dick', last_name: 'Dunlap' }
        ]
      }
    }
  }
</script>

Suppose the table has many rows. I would like to pin the top header row such that when I scroll down the table, the header row showing the column names remains at the top. This makes the table more readable.

The table code was provided in bootstrap-vue documentation.

https://bootstrap-vue.org/docs/components/table

I am using Vue v2.6 and BootstrapVue.

hi there i need if include in my code right or no

#define _stackSize (6748/4) 
#include <Arduino.h>
#include <EEPROM.h>
#ifdef ESP32
#include <WiFi.h>
#else
#include <ESP8266WiFi.h>
#endif
#include <WiFiClientSecure.h>
#include <UniversalTelegramBot.h>
#include <ArduinoJson.h>
#include <SoftwareSerial.h>
 SoftwareSerial Serial2(0, 2); 

my problem in arduino cloude but in arduino ide no error code bulding ok and circuit work normly
the proplem in arduino cloude her
/usr/local/bin/arduino-cli compile –fqbn esp8266:esp8266:nodemcu:baud=115200,dbg=Disabled,eesz=4M,exception=disabled,ip=lm2f,lvl=None____,vt=flash,wipe=none,xtal=80 –build-cache-path /tmp –output-dir /tmp/3426530251/build –build-path /tmp/arduino-build-D609A4CAF9BB322E283BB8346F7F5867 –library /home/builder/opt/libraries/universaltelegrambot_1_1_0 /tmp/3426530251/sketch_nov1a

/tmp/3426530251/sketch_nov1a/sketch_nov1a.ino:68:15: error: ‘TELEGRAM_CERTIFICATE_ROOT’ was not declared in this scope

X509List cert(TELEGRAM_CERTIFICATE_ROOT);

^

/tmp/3426530251/sketch_nov1a/sketch_nov1a.ino: In function ‘void setup()’:

/tmp/3426530251/sketch_nov1a/sketch_nov1a.ino:183:7: error: use of deleted function ‘UniversalTelegramBot& UniversalTelegramBot::operator=(UniversalTelegramBot&&)’

bot = UniversalTelegramBot(BOTtokenChar, client);

^

In file included from /tmp/3426530251/sketch_nov1a/sketch_nov1a.ino:9:0:

/home/builder/opt/libraries/universaltelegrambot_1_1_0/src/UniversalTelegramBot.h:49:7: note: ‘UniversalTelegramBot& UniversalTelegramBot::operator=(UniversalTelegramBot&&)’ is implicitly deleted because the default definition would be ill-formed:

class UniversalTelegramBot {

^

/home/builder/opt/libraries/universaltelegrambot_1_1_0/src/UniversalTelegramBot.h:49:7: error: non-static const member ‘const int UniversalTelegramBot::maxMessageLength’, can’t use default assignment operator

/tmp/3426530251/sketch_nov1a/sketch_nov1a.ino: In function ‘void loop()’:

/tmp/3426530251/sketch_nov1a/sketch_nov1a.ino:242:12: error: ‘result’ was not declared in this scope

result();

^

In file included from /home/builder/Arduino/libraries/arduinojson_6_21_4/src/ArduinoJson/Numbers/FloatTraits.hpp:13:0,

from /home/builder/Arduino/libraries/arduinojson_6_21_4/src/ArduinoJson/Numbers/convertNumber.hpp:15,

from /home/builder/Arduino/libraries/arduinojson_6_21_4/src/ArduinoJson/Variant/VariantData.hpp:9,

from /home/builder/Arduino/libraries/arduinojson_6_21_4/src/ArduinoJson/Variant/VariantFunctions.hpp:9,

from /home/builder/Arduino/libraries/arduinojson_6_21_4/src/ArduinoJson/Variant/JsonVariantConst.hpp:15,

from /home/builder/Arduino/libraries/arduinojson_6_21_4/src/ArduinoJson/Variant/VariantRefBase.hpp:9,

from /home/builder/Arduino/libraries/arduinojson_6_21_4/src/ArduinoJson/Array/ElementProxy.hpp:7,

from /home/builder/Arduino/libraries/arduinojson_6_21_4/src/ArduinoJson/Array/JsonArray.hpp:7,

from /home/builder/Arduino/libraries/arduinojson_6_21_4/src/ArduinoJson.hpp:29,

from /home/builder/Arduino/libraries/arduinojson_6_21_4/src/ArduinoJson.h:9,

from /home/builder/opt/libraries/universaltelegrambot_1_1_0/src/UniversalTelegramBot.h:26,

from /tmp/3426530251/sketch_nov1a/sketch_nov1a.ino:9:

/home/builder/Arduino/libraries/arduinojson_6_21_4/src/ArduinoJson/Polyfills/pgmspace_generic.hpp: In instantiation of ‘const T* ArduinoJson::V6214PB2::detail::pgm_read(const T* const*) [with T = char]’:

/home/builder/Arduino/libraries/arduinojson_6_21_4/src/ArduinoJson/Deserialization/DeserializationError.hpp:85:42: required from here

/home/builder/Arduino/libraries/arduinojson_6_21_4/src/ArduinoJson/Polyfills/pgmspace_generic.hpp:25:52: error: ‘const void*’ is not a pointer-to-object type

return reinterpret_cast<const T*>(pgm_read_ptr(p));

^

Multiple libraries were found for “EEPROM.h”

Used: /home/builder/.arduino15/packages/esp8266/hardware/esp8266/2.5.0/libraries/EEPROM

Not used: /home/builder/opt/libraries/atmac_eeprom_1_0_0

Not used: /home/builder/opt/libraries/arduino_nvm_0_9_1

Not used: /home/builder/opt/libraries/hello_drum_0_7_7

Multiple libraries were found for “UniversalTelegramBot.h”

Used: /home/builder/opt/libraries/universaltelegrambot_1_1_0

Not used: /home/builder/opt/libraries/universaltelegrambot_1_3_0

Multiple libraries were found for “ArduinoJson.h”

Used: /home/builder/opt/libraries/arduinojson_6_21_4

Not used: /home/builder/opt/libraries/antares_esp8266_mqtt_0_9_2

Not used: /home/builder/opt/libraries/balemessengerbot_arduino_0_1_0

Not used: /home/builder/opt/libraries/allthingstalk_lte_m_sdk_2_0_4

Not used: /home/builder/opt/libraries/cmmc_mqtt_connector_1_3_3

Not used: /home/builder/opt/libraries/coogleiot_1_3_1

Not used: /home/builder/opt/libraries/iotkme_3_0_1

Not used: /home/builder/opt/libraries/thingesp_1_3_0

Not used: /home/builder/opt/libraries/antares_esp8266_http_1_3_3

Not used: /home/builder/opt/libraries/thingsiot_1_2_0

Multiple libraries were found for “SoftwareSerial.h”

Used: /home/builder/.arduino15/packages/esp8266/hardware/esp8266/2.5.0/libraries/SoftwareSerial

Not used: /home/builder/opt/libraries/mcci_sofwareserial_3_0_0

Not used: /home/builder/opt/libraries/printoo_library_1_0_2

Not used: /home/builder/opt/libraries/vega_softwareserial_1_0_0

Not used: /home/builder/opt/libraries/dabble_1_5_2

Not used: /home/builder/opt/libraries/espsoftwareserial_8_1_0

Error during build: exit status 1

try delete liabrary same proplem

Console clears after making changes in is file

I started learning Java script very recently and I’m very knew to it. I was trying to learn how to use console but every time I make changes in my js. file in visual studio code, console clears and browser forces the website to reload infinitely until i basically cancel the reload. After closing console window and opening it again only then I see the changes I made in my is. file.
I will highly appreciate your help!

I tried enabling preserve log checkbox in console settings but it didn’t change anything.

JQuery Capitalize First Letter Of Each Word In A Sentence [duplicate]

I’m trying to capitalize first letter of each word from a text field using JQuery but unfortunately I’m unable to.

Below is the Bootstrap code I currently have to get data from a text field from a submitted button

<button class="btn btn-primary" type="button" id="btn4" value="alternatingCase">Alternating Case</button>

Below JQuery code converts only the first letter of the paragraph to caps

$("#btn4").click(function(){
  var input = $("#input1");
  input.val(input.val().charAt(0).toUpperCase() + input.val().substr(1).toLowerCase());
  });

JavaScript error: dataDetailSkill[item].data.map is not a function

export default function DetailSkill() {
const { item } = useParams();
return (
    <div className="w-screen min-h-screen flex flex-col p-[30px] bg-slate-100  overflow-hidden">
        <Header title={item} />
        <div className="mt-12 flex flex-col gap-4">
            <img src={dataDetailSkill[item].bannerImg} alt="" className="w-full h-[200px] object-cover rounded-lg" />
            <p>{dataDetailSkill[item].description}</p>
            <div className="flex flex-col gap-4">
                {dataDetailSkill[item].data.map((v) => {
                    return <SkillCard title={item} content={v.title} img={v.img} link={v.github} key={v.id} />;
                })}
            </div>
        </div>
        <ModalMenu />
    </div>
);

}

what’s wrong with the code. chrome says dataDetailSkill[item].data.map is not a function. I use Vite React. sorry newbie

dataDetailSkill.js
I want to do mapping on the dataDetailSkill.js file but there is an error

export default {
    html: {
        description: "Membuat website sederhana",
        bannerImg: "https://images.pexels.com/photos/4439901/pexels-photo-4439901.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
        data: {
            id: 1,
            title: "Membuat website landing page",
            github: "",
            img: "https://images.pexels.com/photos/114907/pexels-photo-114907.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
        },
    },
    frontend: {
        description: "Membuat website dengan React JS",
        bannerImg: "https://images.pexels.com/photos/4439901/pexels-photo-4439901.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
        data: {
            id: 1,
            title: "Membuat website film",
            github: "",
            img: "https://images.pexels.com/photos/114907/pexels-photo-114907.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
        },
    },
    it: {
        description: "Sertifikat Kepelatihan saya dalam IT",
        bannerImg: "https://images.pexels.com/photos/4439901/pexels-photo-4439901.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
        data: {
            id: 1,
            title: "IT Support",
            github: "",
            img: "https://images.pexels.com/photos/196644/pexels-photo-196644.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
        },
    },
    web: {
        description: "Project membuat web design",
        bannerImg: "https://images.pexels.com/photos/4439901/pexels-photo-4439901.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
        data: {
            id: 1,
            title: "Project saya",
            github: "",
            img: "https://images.pexels.com/photos/196644/pexels-photo-196644.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
        },
    },
};

I’ve followed the tutorial on YouTube but the error still persists

EJS dynamic hyperlink issue

I’m trying to make a hyperlink that grabs the post id from my database and creates a link based on the postID but it doesn’t seem to work

posts.ejs

 <% for (let post of userPosts) { %>
            <% if (currentTopic !== post.name) { %>
                <li><strong><%= post.name %></strong></li>
                <% currentTopic = post.name; %>
            <% } %>
            <li>
                <a href="/article/<%= post.post_id %>"><%= post.post_name %> - <%= post.username %></a>

            </li>
        <% } %>

main.js

  app.get('/article/:postId', function(req, res) {
        const postId = req.params.postId;
        const sqlQuery = 'SELECT * FROM posts WHERE post_id = ?';
    
        db.query(sqlQuery, [postId], (err, result) => {
            if (err || result.length === 0) {
                // Handle error or post not found
                res.send('Post not found.');
            } else {
                const post = result[0];
                res.render('article.ejs', { post });
            }
        });
    });

I can’t seem to find the issue

Database

*create posts table
CREATE TABLE `posts` (
  `post_id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `topic_id` int NOT NULL,
  `post_name` varchar(45) NOT NULL,
  `article` varchar(1000) NOT NULL,
  PRIMARY KEY (`post_id`),
  UNIQUE KEY `post_id_UNIQUE` (`post_id`)
) 

I’ve logged my errors down but i do not get anything when i click on the hyperlink

If I press Ctrl+S on a website and download it to my desktop, then open it in Firefox, can it access my desktop files or install malware?

I downloaded a not-so-reputable website to my desktop as a way to grab the images on the site. I tried opening the HTML and then I remembered hearing that opening a local file in a browser is different from opening a website. Something about http:// and file:/// allowing different levels of access to my computer. Unsure if I should just re-install windows just to be safe.

I tried scanning the website folder with microsoft defender and it said that no threats were found but IDK how foolproof microsoft defender is.