Posts by JeanExtreme002 • 5,663 points
331 posts
-
0
votes1
answer54
viewsQ: Error opening text editor in Git
I’m trying to change the message of my last commit through Git Bash using the command git commit --amend. However, when it attempts to open the editor, Git generates the following error: $ git…
-
-2
votes1
answer33
viewsQ: Tds do not use full table width
I created an HTML page with a table to store four columns (name, date, code and remove button) and, below, a form. I want the table to have a fixed width and height of 95vw and 80vh. To do this, I’m…
-
2
votes2
answers3533
viewsA: Error installing Pyaudio
Pyaudio does not support Python 3.7+, however it is possible to install the package for newer versions through pipwin. Run the code below on your terminal: $ pip install pipwin $ pipwin install…
-
0
votes1
answer104
viewsQ: How to reopen a closed pull request on Github?
I received a Pull Request from someone today in my Github repository, but I accidentally closed it through the comment tab. How do I reopen and accept closed Pull Request?
githubasked JeanExtreme002 5,663 -
-3
votes1
answer28
viewsQ: How to prevent the scrolling of a given element?
I have a list of several items, the first being a <div>. I want this one <div> always be in the same position (visible at the top), regardless of whether the scroll bar moves up or down.…
-
2
votes1
answer138
viewsQ: How does the cloneNode method work?
I am creating an application and need to copy an element to create it again in the HTML page. Searching the internet, I found the method cloneNode. I want to know the following: How the method…
-
0
votes3
answers258
viewsQ: How to search for an element with querySelector filtering through innerText?
I’d like to know how I can through querySelector (or any other function) to obtain one or more elements (<div>, <a>, <button>, ...), filtering through the content of innerText. In…
-
3
votes1
answer53
viewsQ: What are the differences between setInterval x requestAnimationFrame?
I am creating an application where I need to check if an X element was created on the page and thus take some actions. To make that check, I’m using the setInterval. A few minutes ago, I remembered…
-
1
votes0
answers36
viewsQ: Javascript does not work on my Chrome extension
I’m trying to create a simple trial extension for the Chrome browser, where I create a button that when clicked, shows a message inside a <div>. My file manifest.json currently is like this: {…
-
1
votes2
answers378
viewsA: Json - Take key from a value
The object of objects is not to search for keys by values, but values by keys. If you try to search for keys by values, you will encounter two problems: Unnecessarily creating code for a simple…
-
1
votes2
answers177
viewsA: Printing of Matrices in Python
What happens is that your list is one-dimensional and you’re adding the values directly to it. What you should do, is create two lists within this your main list and go adding the values through the…
-
3
votes1
answer473
viewsA: How to insert the value of an Array within another Array
The problem with your code is that you are using the return within the repetition structure. This causes the program to exit the function and consequently, interrupt the repetition loop. Another…
-
0
votes2
answers188
viewsA: How to exchange an image inside a div for javascript
I have no knowledge in Jquery but strongly believe that you are not changing any value, at least not in the second code. That’s because the method attr returns the attribute value and the replace…
-
1
votes5
answers135
viewsA: Problems with arrays in a Python password generator
To join all the letters in a single string, just use the string method join passing the list as argument. See the example below: senha_lista = ["O","z","X","Q","r","n","d","K"] senha_string =…
-
-5
votes2
answers111
viewsQ: How to make the browser render the <span> with some spaces in the text?
I have a <div> which will be used to store information. I want to make a kind of "table", formatting the texts and values so that they are more or less like this: Hot Dog 2,99 Pizza 7 Carro…
-
-1
votes1
answer45
viewsQ: How to fill a DIV with another DIV properly?
I own a <div> to store some elements, and the last element will be another <div>. I want to make this last element tall enough to fill the <div> but without exceeding the limit. To…
cssasked JeanExtreme002 5,663 -
0
votes1
answer70
viewsQ: I can’t center text with "vertical-align"
I want my text to be centered horizontally and vertically on the element <div>. For this, I am using the properties text-align and vertical-align for this element. The problem is that the…
-
1
votes2
answers127
viewsQ: How to remove only the horizontal scrollbar from the page?
I am creating an application in Electron and need to remove from the page a scrollbar horizontal. I tried using the CSS code below, but it also removes the scrollbar vertical. ::-webkit-scrollbar {…
-
2
votes1
answer28
viewsQ: How to center text in the DIV making the lines line up on the left?
I have a <div> with the property text-align: center; so that the text is centralized, but I want the lines of the texts to always start on the left. Below is an example of what I want:…
cssasked JeanExtreme002 5,663 -
1
votes1
answer30
viewsQ: Empty space on top of page when creating a UL on the sidebar side
On my HTML page I created a sidebar and beside a <div> that will guard a <ul>. Before adding this <ul>, the page was the way I wanted it, with no space on top of the sidebar and…
-
0
votes1
answer162
viewsQ: Electron creating various folders and files in my directory
I am developing an application with Electron where I need to store some important data in a directory that I created in %APPDATA%. The problem is that whenever I create this folder (I create using…
electronasked JeanExtreme002 5,663 -
0
votes0
answers79
viewsQ: How to route pages on the Electron?
I have an application in Electron with several HTML files and I would like to create routes in Electron as well as in Express. For example, on the home page of the application the user should log…
-
0
votes1
answer67
viewsQ: Why do Electron applications boot faster the second time?
I’m working with the Electron right now and I noticed something very interesting. Always the first time I open my application with Electron, it takes a long time to boot the window. But the next few…
electronasked JeanExtreme002 5,663 -
0
votes2
answers652
viewsA: Python 3.8 - How to format the display of the elements of a list in column
Just use the method format with the type of formatting :< to add an X amount of spaces to the right of the string, if necessary. See the example code below: alunos = [] for aluno in range(5):…
-
1
votes2
answers86
viewsA: Submit form without button. Only when input is completed
Just create a role for the event oninput to check if the size of the input is greater than five and submit the form. See the code below: function checksInput() { const input =…
-
7
votes3
answers263
viewsQ: What would be something "native"?
I’ve read many posts and articles talking that one language, framework, editor or anything else is "native". So my question is: What is something native? Is that good or bad? There are advantages…
-
0
votes3
answers84
viewsA: Find largest element index in the list
You can use the function map obtain a new list containing the prices of each product. Just pass in the first parameter a function receive an item (tuple) and return the second element of this item…
-
0
votes1
answer80
viewsQ: Electron Node import returns "Undefined"
I want to use Electron with Node, but when importing this framework following the step by step of tutorial of the site, it always returns undefined. // Abaixo tanto o "app" quanto o "BrowserWindow"…
-
2
votes1
answer81
viewsQ: Why declare Static for all methods of a Static class?
I was studying here C# until I got to the part about the static. The teacher shows that it is possible to use this statement in methods and even in the class itself. The problem is that when using…
-
0
votes0
answers58
viewsQ: How are programming languages created?
Sometimes when I program, it occurs to me that I am programming from a program since who interprets or compiles is a program. So I thought, how are programming languages created? Are programming…
characteristic-languageasked JeanExtreme002 5,663 -
2
votes2
answers225
viewsA: Update the value of a variable for the result of its sum with +1
To increment a value in Javascript there are four ways. The most common and simple of all is using the operator ++ that will add +1 value of variable. See example below: var valor = 2; valor++;…
-
1
votes1
answer341
viewsA: Sleep() in javascript
As Guilherme said in the comments on the issue, to solve your problem just use the function setTimeout, performing a function in a asynchronous after waiting a time in milliseconds. See the example…
javascriptanswered JeanExtreme002 5,663 -
0
votes1
answer85
viewsA: Python Array - Highest list value
First of all, you can create a single matrix to store all four branches. This will make it easier to work with the value of branch sales since they will not now be separated into variables. In…
-
0
votes1
answer37
viewsQ: How to obtain an element that is within two or more elements?
I am using the method querySelector to obtain an element that is within three elements of <div> as in the code below: <div class="main"> <div> <div> <span>Elemento…
-
0
votes4
answers747
viewsA: Get the most frequent and least frequent element from a list, plus the largest and smallest
Just use the functions min and max for the smallest and greatest value of a list or any other iterable object such as tuples, dicts, sets, etc. See code below: import random # Gera uma lista com dez…
-
0
votes0
answers102
viewsQ: How do I detect if the browser is downloading a Javascript file?
I am creating an application where I need to detect if the browser is downloading any file, be it script, image, audio or source. How can I do this in Javascript? I’d like something like that: const…
javascriptasked JeanExtreme002 5,663 -
-2
votes1
answer244
viewsQ: How to copy an object array in Javascript?
I have an array of objects and need to create a function that takes this array and returns a new array with new modified objects. See the example below: function increase_age(users) { for (user of…
-
1
votes1
answer160
viewsQ: How to get the content of an image correctly using fetch?
Using the function fetch I need to get the contents of an image obtained from the server response. The problem is that this image is coming with different content than it should. Using "requests" in…
-
0
votes2
answers999
viewsA: I can’t get elements from a page with Puppeteer
The method evaluate is returning the value null because maybe the element doesn’t exist on the page. Either because it hasn’t been loaded yet or because it doesn’t really exist on the current page…
-
-1
votes2
answers999
viewsQ: I can’t get elements from a page with Puppeteer
I’m creating an application to download an Instagram image through the URL and I’m using the package puppeteer to accomplish this task. Within the call of the method evaluate (method to run a JS…
-
1
votes1
answer60
viewsA: Function to import file. py?
This error is being generated because you are trying to import the module py package teste, or at least, that’s how the interpreter understands. In Python language you should not put the file…
-
1
votes1
answer77
viewsA: How to distribute inputs in lists randomly?
You can use the function choice module random passing a list with all its lists as argument. What this function does is to return an element from that list randomly. lista_de_nomes = ["João",…
pythonanswered JeanExtreme002 5,663 -
0
votes4
answers169
viewsA: Python - Return all cities of a.txt file in a percentage range
You can create a function in your code to find all cities that have a rate within a certain range set by you or the user. Within this function just go through the cities and check if the rate of the…
pythonanswered JeanExtreme002 5,663 -
0
votes1
answer457
viewsA: How to use multithreading with requests?
To accomplish this task you can create a Thread object using the module threading. To create a Thread, you must pass the function to be called in the parameter target and then you can pass the…
-
1
votes1
answer67
viewsA: Python: Error in . write() method
The problem is that you are not closing the file in your program to make the changes. To close the file, use the method close() as in the code below. arquivo = open('hello world.txt', 'a')…
-
2
votes2
answers287
viewsA: How to insert a div into a specific div using Javascript
So far everything is correct (if your goal is to create a new element). Once you have inserted the content into the element, just use the method appendChild to add the created element to another…
-
2
votes1
answer75
viewsA: Receipt of findAll() in the nodejs
The problem is that the attribute x is not an object but an array. To get the value of the property email you will need to access the first index of the array that will save an object. After that,…
node.jsanswered JeanExtreme002 5,663 -
1
votes1
answer138
viewsA: How to save Unicode text in a . JSON file without escape sequence?
Just like the Erick spoke in the comments, this conversion happens in the method json.dumps because of the parameter ensure_ascii which is set by default to True. What this parameter does is to…
-
0
votes1
answer138
viewsQ: How to save Unicode text in a . JSON file without escape sequence?
I am creating a program where I need to save in a JSON file a dictionary that contains strings with Unicode characters. See the example below: import json data = {"face": "( ͡° ͜ʖ ͡°)"} with…
-
1
votes1
answer87
viewsA: "Document" can be accessed in a separate HTML Javascript file?
The problem is that you are loading your script before loading the element with your id. So in the script you try to get an element that does not exist. The solution to this problem is to import the…