Most voted questions
150,413 questions
Sort by count of
-
4
votes2
answers67
viewsWhat does the "jsx" prop do in Next.js' jsx <style?
In Next.js, we can insert direct styling into the component through the tag <style jsx>, as in the example: function Vitro() { return ( <div className="vitro"> <style jsx>{` .vitro…
-
4
votes1
answer34
viewsSort with Selection Sort by size and alphabetically
I have a college exercise, but I need some help. I need to do a program that gets a list containing N nomes and returns a list of all received names sorted by size (number of letters) the Selection…
-
4
votes1
answer47
viewsWhy does the "delete" operator not remove references to a deleted Javascript property?
I am reading a book about data structure in Javascript and came across the following situation: why delete does not delete a reference value? I will give an example to be clear. const items = { a:…
javascript characteristic-language objects operators deleteasked 3 years, 6 months ago Mr Genesis 464 -
4
votes1
answer73
viewsWhat is the purpose of the Promises Timers API on Node.js?
Recently, in the version V16.0.0 of Node.js, added the Promises Timers API, and from what I understand, it’s about alter the behavior of standard timers (setTimeout, setImmediate, etc...). These…
-
4
votes1
answer124
viewsHow to discover the CSV delimiter by PHP?
A CSV file can vary the delimiters. I’ve seen it used ; (point-and-comma), , (comma) and up to \t (tab). In PHP, I know it is possible to capture CSV values by informing the delimiter: $delimitador…
-
4
votes1
answer124
viewsWhat does the "value used here after move" error mean in Rust?
I am studying Rust and would like to better understand when I can and when I can’t use the same variable more than once in the same scope. I leave below two examples. In the first, the program works…
-
4
votes0
answers51
viewsGrid with different height
Hello, I was making a table with some information about chefs, but the text is too long so I decided to put a "continue reading" button, when the text opens, the body of the box increases and drags…
-
4
votes1
answer146
viewsWhat is the difference between the "in" operator and the "hasOwnProperty" method in Javascript?
An unexpected behavior (at least for me) occurred with the following excerpt of code that I will demonstrate below: const str = new String('olá SOpt'); console.log('Usando "in"', 'length' in str);…
-
4
votes0
answers38
viewsDo the processes executed in parallel relate to the number of Cpus nuclei?
I’m studying the module multiprocessing of Python, in which allow me to run several processes in parallel (in my understanding). As an illustration case let’s see the example below: import time from…
-
4
votes1
answer50
viewsWhy does C syntax work to create variable range limit in bash?
I tried to create a variable limit in a range for a for loop in bash using a function. Follow my code: function tree(){ let var=$1 for i in {1..$var} do echo $i done } tree 5 To my frustration, this…
-
4
votes1
answer161
viewsAdd different scales in matplotlib
I would like a help to configure the Y-axis scale. When trying to plot a bar graph with low and high values, the smaller ones end up not appearing in the scale. I tried some options, but it does not…
-
4
votes1
answer53
viewsRelate two dataframes using python logic
Hello, I need to relate the two dataframes below using conditions (i) if df1 cat is in the tuple of the df2 cat column; and (ii) the event column. The result should be a column 'Resp' in df1 that…
-
4
votes1
answer79
viewsIs it possible to force a method to be extended in Java?
It is possible to "force" a method to be extensible? The statement of the exercise says exactly this: we have to create a class, within it create a method and force this method to be extended. From…
-
4
votes1
answer96
viewsIs there anything similar to the Optional Chaining (optional chaining) of Javascript in PHP?
We know that in Javascript: The optional chaining (optional chaining operator) ?. allows the reading of the value of a property located internally in a chain of connected objects, without the…
-
4
votes1
answer68
viewsWhat are dependent types and dependent language?
About what they are statically typed languages I am already aware, but the concept of dependently typed language is new to me. I think it has to do with something called dependent types, but I also…
characteristic-language typing language-independent computer-science type-theoryasked 3 years, 7 months ago Luiz Felipe 32,886 -
4
votes2
answers88
viewsA Setter method can receive a getter + value as a parameter?
I created the advisory methods Setter and getter for the balance attribute. It is correct to use these advisors within each other? One being used as parameter for the other. More specifically the…
-
4
votes2
answers54
viewsWhy does creating a list with the same generator only work the first time?
In Python 3.6.8, when I materialize the list, it is shown and erases. This is a bug or so it is? >>> vet_neg ['EH01', 'EH02', 'EH03'] Categories (3, object): ['EH01', 'EH02', 'EH03']…
-
4
votes1
answer80
viewsDoubt about CSS Grid and Firefox
Good night. I recently started to study CSS, but when I was doing an exercise I came across an unusual situation, I am using CSS Grid along with Flexbox, when I review my site in the browsers Opera…
-
4
votes1
answer115
viewsHow to type keys (Keys) of objects nested in Typescript?
I need that guy ColumnDefinitionType accept the object keys IUser, as well as accept the keys of objects nested to the IUser. export interface IUser { userId: number; username: string; name: string;…
-
4
votes1
answer113
viewsLine segments leaving the interior of a map of brazil using package ggrepel
I am trying to reproduce the format of the map below, however, I have been facing some problems to insert these "straights" on the map. After a search, I found the package ggrepel that brings with…
-
4
votes1
answer82
viewsWhy doesn’t Github Workflow start?
I created in my repository (currently, Github master branch) a Workflow to run the tests of my Python application, using the pytest. I set it to run on ubuntu-latest in Python versions (3.6, 3.7 and…
-
4
votes1
answer39
viewsShould reducing functions be created outside or inside my React component?
Looking at the documentation of hook useReducer, I checked that the reducing function is created out of of the component: const initialState = {count: 0}; function reducer(state, action) { switch…
-
4
votes0
answers37
viewsWhat is and what is the exotic Windowproxy object for?
While looking for good links to this answer, I came across a quote from an object called WindowProxy. In the search for explanations, I found this link with the definition: A Windowproxy is an…
-
4
votes1
answer166
viewsWhat is globalThis in Javascript?
I was looking at an example of code and I came across an example that had globalThis: // timeout de 1s globalThis.setTimeout(() => alert('Olá'), 1000); The setTimeout no secrets, but had not yet…
-
4
votes0
answers31
viewsWhat is a TLAB and what is it for?
I recently used Java Mission Control (JMC) to track a memory Leak. In doing so I realized that JMC reports memory allocations inside and outside of Thread Local Allocation Buffers (TLAB). In a quick…
-
4
votes1
answer46
viewsIs there a difference between corroding, fiber and green threads?
According to the title of the question, I see these names being used to describe very similar things. In the Python world we have Greenlets described as corroding and Green Threads. In the Java…
-
4
votes1
answer79
viewsHow to pass a dictionary to the range() function
I was looking at the documentation (docstring) of the range function and came across the following: Init signature: range(self, /, *args, **kwargs) Docstring: range(stop) -> range object…
-
4
votes0
answers47
viewsHow to format a cell number in excel for hours type through Openpyxl (Python)?
Whoa, you guys are fine? So, I’m developing a Python test API that when it’s called, it has to return me an Excel file with pre-defined data. One of these data is a time variable that must be…
-
4
votes1
answer83
viewsHow to establish a minimum and maximum amount of a value required by an input in a JS request?
I have a field called Quantidade that the quantity of products for sale should be inserted. My form has a data request that returns the value and quantity of products in stock, this field Quantidade…
-
4
votes2
answers49
viewsHow to reload a page without losing inputfile
Hello, I have a PHP me code where I use simplexml_load_file to read an xml on this page I need to send a form with submit, My problem is that by sending this form xml data is lost. And I would like…
inputasked 3 years, 8 months ago willian algusto 43 -
4
votes1
answer41
viewsHow to convert regex Pattern from C# to C++?
I’m trying to use C++ regex but I’m having some difficulties, one of them is that Pattern was in a C#code, and I know practically nothing of regex in C++, and so the code does not work as it should…
c++asked 3 years, 8 months ago Luiz Fernando 345 -
4
votes1
answer75
viewsWhat are the best practices for implementing Socket.io?
I am starting my studies on Socket.io, precisely in my project involving the technologies of Vue/quasar, and I would like to understand how the logic behind these following fundamentals unfolds: How…
-
4
votes2
answers48
viewsHow to pass Corner Blob effect to right side of the screen?
I would like to reverse the effect demonstrated by starting from the right side of the screen and expanding to the left side, however, I did not achieve this. Someone could give me a light? const…
-
4
votes0
answers37
viewsWhat are the differences between Asymchronism, Parallelism and Multithread?
Sometimes the terms Asynchronous, Multithread and Parallelism appears whenever I do a search related to multiprocessing or something related. However, I have a hard time understanding the…
-
4
votes1
answer44
viewsValidate from 1 to 6 digits, the first of which cannot be zero
How is regex to validate the following rule: Numbers only; A maximum of 6 numbers, and a minimum of 1; The first number needs to be different from 0; I tried it this way and it didn’t work:…
regexasked 3 years, 9 months ago V. Rodrigues 75 -
4
votes1
answer207
viewsHow to render the same component several times in React?
I’m trying to make a list with a component being repeated certain times. To be clear, I have a ScrollView and its own component PutANumber. I need the ScrollView has a predefined amount of…
-
4
votes1
answer53
viewsAre there abstract classes in Python?
I’m a beginner in Python and would like to know if there are abstract classes and methods in Python, if there is someone can give me an example? When I studied Java there were these classes to…
-
4
votes1
answer140
viewsHow to deal with Undefined (or null) union in Typescript?
I am implementing this method below but it is giving me this error: Type 'Task | Undefined' is not Assignable to type 'Task'. Type 'Undefined' is not Assignable to type 'Task'. I can’t fix it. The…
-
4
votes1
answer36
viewsSort distance record based on latitude and longitude - Laravel
I have a table companies who has a one to one polymorphic relationship with addresses I have the parameter of latitude and longitude and I would like to order the Commissaries to the distance of the…
-
4
votes3
answers214
viewsCalculate increments so that 2 numbers become equal
The problem: With a very creative name, the Protagonist is in his first episode of its incredible saga! In an afternoon any Z, the Protagonist’s best friend, challenged the even for a super fun…
-
4
votes2
answers139
viewsHow to check if there is a property in an object?
I am pulling a back-end user on my front end. How do I check if a property exists in the object usuario? Ex: let usuario = { id: "1", name: "Jose", options: { channel: "1", reference: "a" },…
javascriptasked 3 years, 9 months ago Luck dev 61 -
4
votes1
answer90
viewsHow can I filter two values in my object array?
Hello! I’m having trouble understanding how I can filter the answer I get from my database, its logic is like this: I receive an array of objects from which it has the values of use, useridRequerent…
-
4
votes3
answers283
viewsHow to delete duplicates between multiple tables
I have three tables with structure similar to this: CREATE TABLE itens_chao ( id int PRIMARY KEY AUTO_INCREMENT, pos_x int, pos_y int, nome varchar(255), quantidade int, numero_serie int(11) );…
-
4
votes3
answers125
viewsHow to add one column of data based on another in excel through Pandas?
I have a spreadsheet with multiple import data. The problem is always the format as the data comes. For example, I have a column called "Imported Goods" that has values like the below: 1 X 40…
-
4
votes1
answer40
viewsHow to make a Sort of a converted Nodelist to array?
I am trying to sort the array by the style property order. This is my attempt: var interval = setInterval(() => { var letterDivs = gameBox.getElementsByClassName("wordBox")[0].childNodes;…
-
4
votes3
answers169
viewsWhat is the loading="Lazy" attribute for images and iframes?
To help with my site’s SEO, I use an extension in Chrome called Meta SEO Inspector. After an update, she began to indicate that my site needed to add the attribute loading="lazy" in tags…
-
4
votes1
answer60
viewsProblem with JS and id that only work with the first id used
I’m not a professional developer, but as in any workplace, technical support does everything. I was asked to create a support page for the external sales team, where they can include information…
-
4
votes1
answer118
viewsNumber of Columns X performance in tables
I am working with Mysql 10.x in a table that already has 60 columns, but it turns and moves I need to include more columns, I usually dismember in several tables precisely to not create a very large…
-
4
votes1
answer58
viewsWhy does a function accept a reference instead of returning a value?
Consider the code snippet below: int num; printf("Enter a number: "); scanf("%d", &num); I understand that by passing &num to the second argument of scanf(), step the variable reference num,…
-
4
votes1
answer61
viewsDate count of days when it has turn of year
I’m having trouble generating an iteration where dates are displayed from a given day to the most current day. this problem happens when it has the "turn of the year" and I put a condition of…