javascript – Meu script funciona no console, mas não funciona implementado

Eu tenho um plugin feito com Javascript, o problema é que ele funciona perfeitamente no Console, abrindo o Inspecionar Elementos > Console e usando.

Agora tentando implementar ele diretamente eu tenho problemas.

A parte problemática é exatamente quando eu faço um for.length em uma NodeList de uma ul > li e adiciono um AddEventListener (ou .onclick)

(Sim, estou trabalhando dentro de um windows.load)

Not able to print the elements of html in console using javascript

const personArr = document.querySelectorAll(".person_name");
   personArr.forEach(item => {
    item.addEventListener('click',() => {
    document.querySelector("#insertName").innerText = "";
    document.querySelector("#insertName").innerText = `${item.innerText}`;
    document.querySelector("#insertName").innerText =`${item.id}`;
    
  })
})
      var form = document.getElementById('msg_send_btn');

 form.onclick = function(event) {
        event.preventDefault();
        var input = document.getElementById("write_msg").value
        var id= document.getElementById("insertName").value
         console.log(input)
   console.log(id)
 }
.container {
  max-width: 3000px;
  margin: auto;
}
img {
  max-width: 100%;
}
.inbox_people {
  background: #f8f8f8 none repeat scroll 0 0;
  float: left;
  overflow: hidden;
  width: 40%;
  border-right: 1px solid #c4c4c4;
}
.inbox_msg {
  border: 1px solid #c4c4c4;
  clear: both;
  overflow: hidden;
}
.top_spac {
  margin: 20px 0 0;
}

.recent_heading {
  float: left;
  width: 40%;
}
.srch_bar {
  display: inline-block;
  text-align: right;
  width: 60%;
  padding: ;
}
.headind_srch {
  padding: 10px 29px 10px 20px;
  overflow: hidden;
  border-bottom: 1px solid #c4c4c4;
}

.recent_heading h4 {
  color: #05728f;
  font-size: 21px;
  margin: auto;
}
.srch_bar input {
  border: 1px solid #cdcdcd;
  border-width: 0 0 1px 0;
  width: 80%;
  padding: 2px 0 4px 6px;
  background: none;
}
.srch_bar .input-group-addon button {
  background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
  border: medium none;
  padding: 0;
  color: #707070;
  font-size: 18px;
}
.srch_bar .input-group-addon {
  margin: 0 0 0 -27px;
}

.chat_ib h5 {
  font-size: 15px;
  color: #464646;
  margin: 0 0 8px 0;
}
.chat_ib h5 span {
  font-size: 13px;
  float: right;
}
.chat_ib p {
  font-size: 14px;
  color: #989898;
  margin: auto;
}
.chat_img {
  float: left;
  width: 11%;
}
.chat_ib {
  float: left;
  padding: 0 0 0 15px;
  width: 88%;
}

.chat_people {
  overflow: hidden;
  clear: both;
}
.chat_list {
  border-bottom: 1px solid #c4c4c4;
  margin: 0;
  padding: 18px 16px 10px;
}
.inbox_chat {
  height: 550px;
  overflow-y: scroll;
}

.active_chat {
  background: #ebebeb;
}

.incoming_msg_img {
  display: inline-block;
  width: 6%;
}
.received_msg {
  display: inline-block;
  padding: 0 0 0 10px;
  vertical-align: top;
  width: 92%;
}
.received_withd_msg p {
  background: #ebebeb none repeat scroll 0 0;
  border-radius: 3px;
  color: #646464;
  font-size: 14px;
  margin: 0;
  padding: 5px 10px 5px 12px;
  width: 100%;
}
.time_date {
  color: #747474;
  display: block;
  font-size: 12px;
  margin: 8px 0 0;
}
.received_withd_msg {
  width: 57%;
}
.mesgs {
  float: left;
  padding: 30px 15px 0 25px;
  width: 60%;
}

.sent_msg p {
  background: #05728f none repeat scroll 0 0;
  border-radius: 3px;
  font-size: 14px;
  margin: 0;
  color: #fff;
  padding: 5px 10px 5px 12px;
  width: 100%;
}
.outgoing_msg {
  overflow: hidden;
  margin: 26px 0 26px;
}
.sent_msg {
  float: right;
  width: 46%;
}
.input_msg_write input {
  background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
  border: medium none;
  color: #4c4c4c;
  font-size: 15px;
  min-height: 48px;
  width: 100%;
}

.type_msg {
  border-top: 1px solid #c4c4c4;
  position: relative;
}
#msg_send_btn {
  background: #05728f none repeat scroll 0 0;
  border: medium none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  font-size: 17px;
  height: 33px;
  position: absolute;
  right: 0;
  top: 11px;
  width: 33px;
}
.messaging {
  padding: 0 0 50px 0;
}
.msg_history {
  height: 516px;
  overflow-y: auto;
}
<html>

<head>
  <link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">

  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" type="text/css" rel="stylesheet">

  <div class="container">
    <h3 class=" text-center">Messaging</h3>
    <div class="messaging">
      <div class="inbox_msg">
        <div class="inbox_people">
          <div class="headind_srch">
            <div class="recent_heading">
              <h4>Recent</h4>
            </div>
            <div class="srch_bar">
              <div class="stylish-input-group">
                <input type="text" class="search-bar" placeholder="Search">
                <span class="input-group-addon">
                  <button type="button"> <i class="fa fa-search" aria-hidden="true"></i> </button>
                </span> </div>
            </div>
          </div>

          <div class="inbox_chat">
            <div class="chat_list active_chat">
              <div class="chat_people">

                <div class="chat_ib">
                  <h5><a href="#" class="person_name" id="1">satya <span class="chat_date"></span></a></h5>
                  
                  <p></p>
                </div>

              </div>
            </div>
            <div class="chat_list active_chat">
              <div class="chat_people">

                <div class="chat_ib">
                  <h5><a href="#" class="person_name" id="2">ferin <span class="chat_date"></span></a></h5>
                  
                  <p></p>
                </div>

              </div>
            </div>
            <div class="chat_list active_chat">
              <div class="chat_people">

                <div class="chat_ib">
                  <h5><a href="#" class="person_name" id="3">laxmi<span class="chat_date"></span></a></h5>
                  
                  <p></p>
                </div>

              </div>
            </div>
          </div>

        </div>

        <div class="mesgs">
          <div class="msg_history">
            <p id="insertName"></p>
            <div class="type_msg">
              <div class="input_msg_write">
                <input type="text" id="write_msg" placeholder="Type a message" />
                <button id="msg_send_btn" type="button"><i class="fa fa-paper-plane-o" aria-hidden="true"></i></button>
              </div>
            </div>
          </div>
        </div>

      </div>
    </div>
    </body>

</html>

javascript – Mostrar console na página HTML

Eu queria mostrar o console dentro da página.
Exemplo:
Javascript

var ran = Math.random();

console.log(ran);

HTML

<div id="Console">
    <p>Valor do console</p>
</div>

É possível mostrar o console na página? Se sim como eu seria possível fazer isso

Does the discussion “console games vs PC” still exist?

As far as I can remember, I’ve observed as teenager an ongoing discussion in the 90s, if not even a flame war, between console and PC gamers.

  • For most, having both a PC and a gaming console was simply not affordable
  • Generally, PC games seemed to have larger variety of game genres and generally provide access to more complex games, but consoled seemed to offer more colorful and vivid experiences.
  • Some games where of course then ported between different platforms, some not.

Now I must admit I am almost out of the world of games since more than two decades.

Today, as far as I can see, really many games releases appear simultaneously for many platform.

My question:

  • Does the discussion still exist in the gaming community, I mean, if yes, what are non-opiniated hard facts in this discussion? (beyond simple taste preference)
  • Or can we state, consoles have become more or less very specialized PCs?

integrity – How do you securely give access to a Java App interactive console (Linux/GNU)?

I have a Java App running, which prints out messages into STDOUT and also has an active interactive console (also accepts STDIN), when the server has started up.

How do I securely give access to an external person (outside the network) to the console and nothing else?

I was figuring using ncat --ssl -e java filenamehere

And setting a firewall rule for the port used to only allow packets from one origin:

iptables -I INPUT ! --src 1.2.3.4 -m tcp -p tcp --dport 777 -j DROP # if it's not 1.2.3.4, drop it

But is that secure?

In theory, IP spoofing can be used or are modern mitigation methods built into the OS? I tried setting nospoof on in the host.conf file but it seems that it’s obsolete.

I was thinking of giving reverse-shell but that probably is a bit too much and insecure in my opinion. What is your opinion?

c – Open the window for creating new messages via Gmail using the console

At the beginning of the 90s I created a program in Cliper, which I later had to adapt to the new times via HMG.

I created a function that opens the window for creating a new Gmail message where only the recipient's email address is added.

I put in this function:
RUN "START chrome.exe https://mail.google.com/mail/?view=cm&to=someone@example.com"

It opens the writing window but does not give me the recipient's email address.

I created a .bat with this code to see what answer it gives me with this code:
@ ECHO OFF
START chrome.exe https://mail.google.com/mail/?view=cm&to=someone@example.com
BREAK

As with the program, it opens the writing window, but does not give me the recipient's email address.

And after running .bat, I get the following message in the console window:

"to" is not recognized as an internal or external command, program or executable batch file.

I would appreciate your help.

filemanager – File sorting in console and file manager are wrong

I hope you can help me, this is my first post here and my english is not that good, i am using google translator

I am using Ubuntu 18.04.4 LTS

I want to decompress many files into one file, but the wrong file starts

It should be the one with the letters aa at the end of the file name, which should be the first, but not

I tried running pigz -t to test the files. It is clear that the file must be tested last with aa (see link file manager and console).

What can I do to sort the files in the correct order?

Convert c # list to a table in the console

I'm doing a function to convert a list of integers to a string in the form of a table in the application console.
In code, I convert the list to a string that separates each element with spaces.

This is currently my code.

    public static void ConsoleTable()
    {
        var list = new List { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
        var listToString = string.Join(" ", list.Select(x => x));

        Console.WriteLine($"{listToString,20} {listToString,20} {listToString,20}");
    }

The current result is: 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9

I want my function to break the line every three numbers, just like in a lottery game, but I don't understand it.
E.g.:
1 2 3 1 2 3 1 2 3
4 5 6 4 5 6 4 5 6
7 8 9 7 8 9 7 8 9